GET/conversation/{conversation_id}
This method can be used to retrieve messages within a specific conversation.
The conversation_id of the conversation for which to retrieve messages is required as path parameters, and the and conversation_type of the conversation is required as a query parameter.
Input
Resource URI
This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com
URI parameters
| Parameter | Type | Description |
|---|---|---|
| conversation_id | string | This path parameters specifies the unique identifier of the conversation that is to be retrieved. Use the getConversations method to retrieve conversation ID values. Occurrence: Required |
| conversation_type | string | This query parameter specifies the type of the conversation being retrieved. This parameter is always required when using the this method. Valid values:
Occurrence: Required |
| limit | integer | The maximum number of entries that can be returned on each page of the paginated response. Use this parameter in conjunction with the offset parameter to control the pagination of the output. For example, if offset is set to 10 and limit is set to 10, the call retrieves entries 11 through 20 from the result set.Note: This feature employs a zero-based list, where the first item in the list has an offset of 0.If this parameter is omitted, the default value is used. Default: 25 Maximum: 50 Occurrence: Optional |
| offset | integer | The number of reports to skip in the result set before returning the first entry in the paginated response. Use this parameter in conjunction with the limit parameter to control the pagination of the output. For example, if offset is set to 0 and limit is set to 10, the first page of the response will contain the first 10 entries from the complete list retrieved by the call.Note: This feature employs a zero-based list, where the first item in the list has an offset of 0.If this parameter is omitted, the default value is used. Default: 0 Occurrence: Optional |
HTTP request headers
All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.
All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.
OAuth scope
This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):
https://api.ebay.com/oauth/api_scope/commerce.message
See OAuth access tokens for more information.
Request payload
This call has no payload.
Request fields
This call has no field definitions.
Output
HTTP response headers
This call has no response headers.
Response payload
Response fields
| Output container/field | Type | Description |
|---|---|---|
| conversationStatus | string | The current status of the conversation, such as Occurrence: Always |
| conversationTitle | string | The title of the conversation. Occurrence: Always |
| conversationType | string | The type of the conversation, such as Occurrence: Always |
| href | string | The URI to the current page of results. Occurrence: Always |
| limit | integer | The value of the limit parameter submitted in the request. Occurrence: Always |
| messages | array of MessageDetail | This array returns a list of messages from the specified conversation. Occurrence: Always |
| messages.createdDate | string | The date, in ISO 8601 format, the message was received. Occurrence: Always |
| messages.messageBody | string | The message text. Occurrence: Always |
| messages.messageId | string | The unique identifier of the message. Occurrence: Always |
| messages.messageMedia | array of MessageMedia | This array returns a list, if applicable, of media attached to the message. Occurrence: Conditional |
| messages.messageMedia.mediaName | string | The name of the media attached to the message. Occurrence: Conditional |
| messages.messageMedia.mediaType | string | The type of media attached to the message.
Occurrence: Conditional |
| messages.messageMedia.mediaUrl | string | The URL of the self-hosted media attached to the message. URLs must use the "HTTPS" protocol. Occurrence: Conditional |
| messages.readStatus | boolean | This boolean indicates if the message has been viewed by the recipient. Occurrence: Always |
| messages.recipientUsername | string | The eBay username of the message recipient. Occurrence: Always |
| messages.senderUsername | string | The eBay username of the message sender. Occurrence: Always |
| messages.subject | string | The subject line of the message. Occurrence: Conditional |
| next | string | The URI for the next page of results. Occurrence: Conditional |
| offset | integer | The value of the offset parameter submitted in the request. Occurrence: Always |
| prev | string | The URI for the previous page of results. Occurrence: Conditional |
| total | integer | The total number of entries returned in the result set. Occurrence: Always |
HTTP status codes
This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.
| Status | Meaning |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
| Code | Domain | Category | Meaning |
|---|---|---|---|
| 335000 | API_MESSAGE | APPLICATION | Internal server error encountered. If this problem persists, contact the eBay Developers Program for support. |
| 355007 | API_MESSAGE | REQUEST | Invalid or unrecognized conversation_id value. |
| 355008 | API_MESSAGE | REQUEST | Invalid offset. The offset value must be a positive integer value and synchronized up with the limit value. If the limit value is 20, value offset values would be 0, 20, 40, etc. |
| 355009 | API_MESSAGE | REQUEST | Invalid limit. The limit value must be a positive integer value that does not exceed {maximumAllowedLimitNumber}. |
Warnings
This call has no warnings.
Samples
New to making API calls? Please see Making a Call.
Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.
Sample 1: Retrieve messages from a conversation
This method can be used to retrieve messages, and their details, from a specific conversation.
Input
The conversation_id of the conversation for which to retrieve messages is required as a path parameter for this method. The conversation_type of the conversation is also required as a query parameter.
GEThttps://api.ebay.com/commerce/message/v1/conversation/4********d?conversationType=FROM_MEMBERS&limit=3
Output
If the call is successful, details about each message within the specified conversation (and within the specified filter parameters) will be returned. This can include information such as the message text and ID, its read status, and the usernames of the sender and recipient.