eBay Trading APIVersion 1039

GetMyMessages

Use this call to retrieve information about the threaded messages sent to a user's My Messages mailbox.

Depending on the detail level, the response can include message counts and headers, resolution status and flagged status, and message text.

Note: GetMyMessages requires a DetailLevel in the request. Otherwise, an error is returned.

Please note that alerts are treated as flagged messages. Data formerly in the Alerts container now is returned in the Messages container, and the Alerts container is empty. For each high priority message, the Flagged field has a value of true. When the Flagged field is true, it means the message is displayed with a flag in the seller's My Messages mailbox on eBay. It is strongly recommended that the seller act on the message by the specified date (or within 60 days, if not specified).

GetMyMessages returns more types of messages than GetMemberMessages. GetMemberMessages returns more nodes per message than GetMyMessages.

The output of GetMyMessages is available as a notification. See MyMessages Notification.

For maximum efficiency, make sure your application can first call GetMyMessages with DetailLevel set to ReturnHeaders. Initially, do not specify any message ID. Your application should be able to cache the returned message ID values. Your application also should be able to create new My Messages requests (up to 10 cached message ID values per request).

Usage Details

With a detail level of ReturnHeaders or ReturnMessages, GetMyMessages only accepts 10 unique message ID values, per request.

Controlling the Volume of the Response

Depending on the activity of the user, GetMyMessages can return an overwhelming amount of data. To reduce the volume of the response, you can restrict the number of messages returned by adding different filters to your request:

See the Samples section for calls that use these filtering mechanisms.

This call returns the text of the messages embedded in HTML code. You can parse the content from the HTML, or you can pass along the code as-is, depending on your needs.

Optimizing Your Calls

To make the most of your GetMyMessages calls, make one call with DetailLevel set to ReturnHeaders, without including MessageID values. This will return a complete list of message headers with their corresponding message ID values. Cache these ID values and use them in a second call to GetMyMessages with DetailLevel set to ReturnMessages. Using this method, you can retrieve details of up to ten specific messages at a time.

Testing GetMyMessages

You can test GetMyMessages in the Sandbox.

Several API calls allow you to replenish your supply of messages in the Sandbox. See Sending and Receiving Messages for information on adding new messages. You can contact Developer Support to obtain further testing information.

Related Information

See:
    Communication Between Members
    Notifications for Buyers and Sellers

See also the reference documentation for these calls:



Input

See also Samples.

The box below lists all fields that could be included in the call request. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).

See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are (or soon will be) non-operational.

The XML prototype does not include requester credentials. This is a documentation limitation only (see Standard Requester Credentials for Making Calls).

<?xml version="1.0" encoding="utf-8"?>
<GetMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Call-specific Input Fields -->
  <EndTime> dateTime </EndTime>
  <ExternalMessageIDs> MyMessagesExternalMessageIDArrayType
    <ExternalMessageID> MyMessagesExternalMessageIDType (string) </ExternalMessageID>
    <!-- ... more ExternalMessageID values allowed here ... -->
  </ExternalMessageIDs>
  <FolderID> long </FolderID>
  <IncludeHighPriorityMessageOnly> boolean </IncludeHighPriorityMessageOnly>
  <MessageIDs> MyMessagesMessageIDArrayType
    <MessageID> MyMessagesMessageIDType (string) </MessageID>
    <!-- ... more MessageID values allowed here ... -->
  </MessageIDs>
  <Pagination> PaginationType
    <EntriesPerPage> int </EntriesPerPage>
    <PageNumber> int </PageNumber>
  </Pagination>
  <StartTime> dateTime </StartTime>
  <!-- Standard Input Fields -->
  <DetailLevel> DetailLevelCodeType </DetailLevel>
  <!-- ... more DetailLevel values allowed here ... -->
  <ErrorLanguage> string </ErrorLanguage>
  <MessageID> string </MessageID>
  <OutputSelector> string </OutputSelector>
  <!-- ... more OutputSelector values allowed here ... -->
  <Version> string </Version>
  <WarningLevel> WarningLevelCodeType </WarningLevel>
</GetMyMessagesRequest>
Argument Type Occurrence Meaning
Call-specific Input Fields [Jump to standard fields]
EndTime dateTime Conditional The end of the date-range filter. See StartTime (which is the beginning of the date-range filter).
ExternalMessageIDs MyMessagesExternalMessageIDArrayType Optional This field is currently available on the US site. A container for IDs that uniquely identify messages for a given user. If provided at the time of message creation, this ID can be used to retrieve messages and will take precedence over message ID.
ExternalMessageIDs
  .ExternalMessageID
MyMessagesExternalMessageIDType (string) Optional,
repeatable: [0..*]
Currently available on the US site. A message ID that uniquely identifies a message for a given user. If provided at the time of message creation, this ID can be used to retrieve messages, and will take precedence over the message ID. A total of 10 message IDs can be specified.
FolderID long Optional A unique identifier for a My Messages folder. If a FolderID value is provided, only messages from the specified folder are returned in the response.
IncludeHighPriorityMessageOnly boolean Optional If this field is included in the request and set to true, only High Priority messages are returned in the response.
MessageIDs MyMessagesMessageIDArrayType Conditional This container can be used to retrieve one or more specific messages identified with their unique MessageID values. Up to 10 MessageID values can be specified with one call.
MessageIDs.MessageID MyMessagesMessageIDType (string) Conditional,
repeatable: [0..*]
An ID that uniquely identifies a message for a given user.
Pagination PaginationType Optional Specifies how to create virtual pages in the returned list (such as total number of entries and total number of pages to return). Default value for EntriesPerPage with GetMyMessages is 25.
Pagination.EntriesPerPage int Optional This integer value is used to specify the maximum number of entries to return in a single "page" of data. This value, along with the number of entries that match the input criteria, will determine the total pages (see PaginationResult.TotalNumberOfPages) in the result set.

The maximum and default values are not the same for all calls. For most Trading API calls, the maximum value is 200 and the default value is 25 entries per page.
Pagination.PageNumber int Optional Specifies the number of the page of data to return in the current call. Default is 1 for most calls. For some calls, the default is 0. Specify a positive value equal to or lower than the number of pages available (which you determine by examining the results of your initial request). See the documentation for the individual calls to determine the correct default value.

Min: 1. Default: 1.
StartTime dateTime Optional The beginning of the date-range filter. Filtering takes into account the entire timestamp of when messages were sent. Messages expire after one year.
Standard Input Fields  
DetailLevel DetailLevelCodeType Required,
repeatable: [1..*]
Detail levels are instructions that define standard subsets of data to return for particular data components (e.g., each Item, Transaction, or User) within the response payload. For example, a particular detail level might cause the response to include buyer-related data in every result (e.g., for every Item), but no seller-related data.

Specifying a detail level is like using a predefined attribute list in the SELECT clause of an SQL query. Use the DetailLevel element to specify the required detail level that the client application needs pertaining to the data components that are applicable to the request.

The DetailLevelCodeType defines the global list of available detail levels for all request types. Most request types support certain detail levels or none at all. If you pass a detail level that exists in the schema but that isn't valid for a particular request, eBay ignores it and processes the request without it.

For each request type, see the detail level tables in the Input/Output Reference to determine which detail levels are applicable and which elements are returned for each applicable detail level.

Note that DetailLevel is required input for GetMyMessages.

With GetSellerList and other calls that retrieve large data sets, please avoid using ReturnAll when possible. For example, if you use GetSellerList, use GranularityLevel instead, or use GetSellerEvents. If you do use 'ReturnAll' with GetSellerList, use a small Pagination.EntriesPerPage value and a narrow EndTimeFrom/EndTimeTo date range for better performance.

Applicable values:

ReturnHeaders
(in) Returns message headers. For GetMyMessages, if you include MessageIDs or AlertIDs in the request, this detail level returns header information, without body text, for the specified message ID or alert ID values. If you include a FolderID, header information is returned only for the messages and alerts in the specified folder.

If you do not include MessageIDs or AlertIDs, this detail level returns header information for Alerts and Messages as follows:
  • If all the Alerts have been read, they are sorted in date order, with the most recent first.
  • If one of the Alerts has not been read, the Read Alerts come first, sorted most recent first, followed by the Unread Alert(s).
  • All messages in ascending order by date received with the oldest messages first.

Note: Even when restricted by this detail level to return only header information, GetMyMessages may return a high volume of data.
ReturnMessages
(in) Returns full message information. For GetMyMessages, if you include MessageIDs or AlertIDs in the request, this detail level returns message information for the specified message ID or alert ID values. If you include a FolderID, message information is returned only for the messages and alerts in the specified folder.
ReturnSummary
(in) Returns the summary data. For GetMyMessages, this detail level returns the same data whether or not you include MessageIDs or AlertIDs in the request. Returns up to 10 FolderID and FolderName values. Currently, this detail level is the only way to retrieve FolderID and FolderName values. See GetMyMessages for a code sample that demonstrates this.

(Not all values in DetailLevelCodeType apply to this field.)
ErrorLanguage string Optional Use ErrorLanguage to return error strings for the call in a different language from the language commonly associated with the site that the requesting user is registered with. Specify the standard RFC 3066 language identification tag (e.g., en_US).

ID Country
en_AU Australia
de_AT Austria
nl_BE Belgium (Dutch)
fr_BE Belgium (French)
en_CA Canada
fr_CA Canada (French)
zh_CN China
fr_FR France
de_DE Germany
zh_HK Hong Kong
en_IN India
en_IE Ireland
it_IT Italy
nl_NL Netherlands
en_SG Singapore
es_ES Spain
de_CH Switzerland
en_GB United Kingdom
en_US United States

See Tags for the Identification of Languages.

MessageID string Optional Most Trading API calls support a MessageID element in the request and a CorrelationID element in the response. If you pass in a MessageID in a request, the same value will be returned in the CorrelationID field in the response. Pairing these values can help you track and confirm that a response is returned for every request and to match specific responses to specific requests. If you do not pass a MessageID value in the request, CorrelationID is not returned.

Note: GetCategories is designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable.
OutputSelector string Optional,
repeatable: [0..*]
You can use the OutputSelector field to restrict the data returned by a call. This field can make the call response easier to manage, especially when a large payload is returned. If you use the OutputSelector field, the output data will only include the fields you specified in the request. For example, if you are using GetItem and you only want to retrieve the URL of the View Item page (emitted in ViewItemURL field) and the item's Buy It Now price (emitted in BuyItNowPrice field), you would include two separate OutputSelector fields and set the value for each one as ViewItemURL and BuyItNowPrice as in the following example:

 ...
<OutputSelector>ViewItemURL</OutputSelector>
<OutputSelector>BuyItNowPrice</OutputSelector>

...

See Selecting Fields to Retrieve.

Version string Conditional The version number of the API code that you are programming against (e.g., 859). The version you specify for a call has these basic effects:
  • It indicates the version of the code lists and other data that eBay should use to process your request.
  • It indicates the schema version you are using.
You need to use a version that is greater than or equal to the lowest supported version.
For the SOAP API: If you are using the SOAP API, this field is required. Specify the version of the WSDL your application is using.

For the XML API: If you are using the XML API, this field has no effect. Instead, specify the version in the X-EBAY-API-COMPATIBILITY-LEVEL HTTP header. (If you specify Version in the body of an XML API request and it is different from the value in the HTTP header, eBay returns an informational warning that the value in the HTTP header was used instead.)

See:
    Routing the Request (Gateway URLs)
    eBay Schema Versioning Strategy
    Lowest Supported Version

WarningLevel WarningLevelCodeType Optional Controls whether or not to return warnings when the application passes unrecognized or deprecated elements in a request.

An unrecognized element is one that is not defined in any supported version of the schema. Schema element names are case-sensitive, so using WarningLevel can also help you remove any potential hidden bugs within your application due to incorrect case or spelling in field names before you put your application into the Production environment.

WarningLevel only validates elements; it doesn't validate XML attributes. It also doesn't control warnings related to user-entered strings or numbers, or warnings for logical errors.

We recommend that you only use this during development and debugging. Do not use this in requests performed in the Production environment.

Applicable values:

High
(in) The WarningLevel value is set to High if the user wishes to receive warnings when the application passes unrecognized or deprecated elements in an API call request. Setting the WarningLevel value to High is not recommended in a production environment. Instead, it should only be used during the development/debugging stage.
Low
(in) The WarningLevel value is set to Low if the user does not wish to receive warnings when the application passes unrecognized or deprecated elements in an API call request. This is the default value if WarningLevel is not specified in the call request.

See Warning Level.



Output

See also Samples.

The box below lists all fields that might be returned in the response. To learn more about an individual field or its type, click its name in the box (or scroll down to find it in the table below the box).

See also the Deprecated Objects link above. Fields presented in this color are deprecated, and fields presented in this color are not returned (or soon will not be returned) or are not operational (or soon will be non-operational).

<?xml version="1.0" encoding="utf-8"?>
<GetMyMessagesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <!-- Call-specific Output Fields -->
  <Messages> MyMessagesMessageArrayType
    <Message> MyMessagesMessageType
      <Content> string </Content>
      <ExpirationDate> dateTime </ExpirationDate>
      <ExternalMessageID> string </ExternalMessageID>
      <Flagged> boolean </Flagged>
      <Folder> MyMessagesFolderType
        <FolderID> long </FolderID>
      </Folder>
      <HighPriority> boolean </HighPriority>
      <ItemEndTime> dateTime </ItemEndTime>
      <ItemID> ItemIDType (string) </ItemID>
      <ItemTitle> string </ItemTitle>
      <ListingStatus> ListingStatusCodeType </ListingStatus>
      <MessageID> MyMessagesMessageIDType (string) </MessageID>
      <MessageMedia> MessageMediaType
        <MediaName> string </MediaName>
        <MediaURL> anyURI </MediaURL>
      </MessageMedia>
      <!-- ... more MessageMedia nodes allowed here ... -->
      <MessageType> MessageTypeCodeType </MessageType>
      <QuestionType> QuestionTypeCodeType </QuestionType>
      <Read> boolean </Read>
      <ReceiveDate> dateTime </ReceiveDate>
      <RecipientUserID> string </RecipientUserID>
      <Replied> boolean </Replied>
      <ResponseDetails> MyMessagesResponseDetailsType
        <ResponseEnabled> boolean </ResponseEnabled>
        <ResponseURL> anyURI </ResponseURL>
      </ResponseDetails>
      <Sender> string </Sender>
      <SendToName> string </SendToName>
      <Subject> string </Subject>
      <Text> string </Text>
    </Message>
    <!-- ... more Message nodes allowed here ... -->
  </Messages>
  <Summary> MyMessagesSummaryType
    <FlaggedMessageCount> int </FlaggedMessageCount>
    <FolderSummary> MyMessagesFolderSummaryType
      <FolderID> long </FolderID>
      <FolderName> string </FolderName>
      <NewAlertCount> int </NewAlertCount>
      <NewHighPriorityCount> int </NewHighPriorityCount>
      <NewMessageCount> int </NewMessageCount>
      <TotalAlertCount> int </TotalAlertCount>
      <TotalHighPriorityCount> int </TotalHighPriorityCount>
      <TotalMessageCount> int </TotalMessageCount>
    </FolderSummary>
    <!-- ... more FolderSummary nodes allowed here ... -->
    <NewHighPriorityCount> int </NewHighPriorityCount>
    <NewMessageCount> int </NewMessageCount>
    <TotalHighPriorityCount> int </TotalHighPriorityCount>
    <TotalMessageCount> int </TotalMessageCount>
  </Summary>
  <!-- Standard Output Fields -->
  <Ack> AckCodeType </Ack>
  <Build> string </Build>
  <CorrelationID> string </CorrelationID>
  <Errors> ErrorType
    <ErrorClassification> ErrorClassificationCodeType </ErrorClassification>
    <ErrorCode> token </ErrorCode>
    <ErrorParameters ParamID="string"> ErrorParameterType
      <Value> string </Value>
    </ErrorParameters>
    <!-- ... more ErrorParameters nodes allowed here ... -->
    <LongMessage> string </LongMessage>
    <SeverityCode> SeverityCodeType </SeverityCode>
    <ShortMessage> string </ShortMessage>
  </Errors>
  <!-- ... more Errors nodes allowed here ... -->
  <HardExpirationWarning> string </HardExpirationWarning>
  <Timestamp> dateTime </Timestamp>
  <Version> string </Version>
</GetMyMessagesResponse>
Return Value Type Occurrence Meaning
Call-specific Output Fields [Jump to standard fields]
Messages MyMessagesMessageArrayType Always This container consists of an array of one or more messages that match the search criteria in the call request.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message MyMessagesMessageType Conditionally,
repeatable: [0..*]
A Message container is returned for each message that matches the input criteria in the call request. Each Message container consists of detailed information on a message. The amount of information that is returned in each Message container is partially dependent on the value that is set in the required DetailLevel field.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Content string Conditionally Message body in plain text format. The message body is displayed in plain text even if the eBay user's Preferred Email Format preference on My eBay is set to HTML. Graphics and text formatting are dropped if the eBay user's preference is set to HTML.

DetailLevel: ReturnMessages.
Messages.Message
  .ExpirationDate
dateTime Conditionally Date and time at which a message expires.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message
  .ExternalMessageID
string Conditionally ID used by an external application to uniquely identify a message. Returned only when specified by the external application on message creation.

This value is equivalent to the value used for MessageID in GetMemberMessages.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Flagged boolean Conditionally Indicates if the message is displayed with a flag in the seller's My Messages mailbox on eBay. It is strongly recommended that the seller act on the message by the specified date (or within 60 days, if not specified).

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Folder MyMessagesFolderType Conditionally Details relating to a My Messages folder.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Folder
  .FolderID
long Conditionally An ID that uniquely identifies a My Messages folder.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.HighPriority boolean Conditionally Indicates if this message is marked as a high-priority message.
Messages.Message.ItemEndTime dateTime Conditionally Date and time for the ended item.
Messages.Message.ItemID ItemIDType (string) Conditionally Unique item ID. Not returned for messages that haven't been associated with a specific item.
Max length: 19 (Note: The eBay database specifies 38. Currently, Item IDs are usually 9 to 12 digits).

DetailLevel: ReturnHeaders.
Messages.Message.ItemTitle string Conditionally Title of the item listing.
Max length: 55.
Messages.Message.ListingStatus ListingStatusCodeType Conditionally Coming soon. Specifies an active or ended listing's status in eBay's processing workflow. If a listing ends with a sale (or sales), eBay needs to update the sale details (e.g., total price and buyer/high bidder) and the final value fee. This processing can take several minutes. If you retrieve a sold item and no details about the buyer/high bidder are returned or no final value fee is available, use this listing status information to determine whether eBay has finished processing the listing.

Note: For GetMyMessages, the listing status reflects the status of the listing at the time the question was created. The listing status for this call must not match the listing status returned by other calls (such as GetItemTransactions). This is returned only if Messages.Message.MessageType is AskSellerQuestion. This tag is no longer returned in the Sandbox environment.

Applicable values:

Active
(out) The listing is still active or the listing has ended with a sale but eBay has not completed processing the sale details (e.g., total price and high bidder). A multi-item listing is considered active until all items have winning bids or purchases or the listing ends with at least one winning bid or purchase. If the listing has ended with a sale but this Active status is returned, please allow several minutes for eBay to finish processing the listing.
Completed
(out) The listing has closed and eBay has completed processing the sale. All sale information returned from eBay (e.g., total price and high bidder) should be considered accurate and complete. Although the Final Value Fee (FVF) for FixedPriceItem and StoresFixedPrice items is returned by GetSellerTransactions and GetItemTransactions, all other listing types (excluding Buy It Now purchases) require the listing status to be Completed before the Final Value Fee is returned.
Custom
(out) Reserved for internal or future use.
CustomCode
(out) Reserved for internal or future use.
Ended
(out) The listing has ended. If the listing ended with a sale, eBay has completed processing of the sale. All sale information returned from eBay (e.g., total price and high bidder) should be considered accurate and complete. However, the final value fee is not yet available.

Code so that your app gracefully handles any future changes to this list.
Messages.Message.MessageID MyMessagesMessageIDType (string) Conditionally ID that uniquely identifies a message for a given user.

This value is not the same as the value used for the GetMemberMessages MessageID. Use the GetMemberMessages value (used as the GetMyMessages ExternalID) instead.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.MessageMedia MessageMediaType Conditionally,
repeatable: [0..*]
Media details stored as part of the message.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.MessageMedia
  .MediaName
string Conditionally The name of the image. This will be displayed on the flimstrip.
Max length: 100.
Messages.Message.MessageMedia
  .MediaURL
anyURI Conditionally URL of an image to be included in a message. The image must be uploaded to EPS (eBay Picture Services) using a separate API call or the web flow. This URL will be validated and if it doesn't exist, the request will fail.
Max length: 200.
Messages.Message.MessageType MessageTypeCodeType Conditionally Type of message being retrieved through GetMyMessages. This is available only on the US site.

Applicable values: See MessageType.
Code so that your app gracefully handles any future changes to this list.
Messages.Message.QuestionType QuestionTypeCodeType Conditionally Coming soon. Currently available only on the US site. Context of the question (e.g. Shipping, General). Corresponds to the message subject. Applies if Messages.Message.MessageType is AskSellerQuestion.

Applicable values: See QuestionType.
Code so that your app gracefully handles any future changes to this list.
Messages.Message.Read boolean Conditionally Indicates if a message has been viewed by a given user. Note that retrieving a message with the API does not mark it as read.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.ReceiveDate dateTime Conditionally Date and time that a message was received by My Messages and stored in a database for the recipient.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message
  .RecipientUserID
string Conditionally Displayable user ID of the recipient.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Replied boolean Conditionally Indicates if there has been a reply to the message.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message
  .ResponseDetails
MyMessagesResponseDetailsType Conditionally Details relating to the response to a message.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message
  .ResponseDetails
  .ResponseEnabled
boolean Conditionally Whether a message can be responded to. To respond to a message, use the URL in ResponseURL. You may need to log into the eBay Web site to complete the response.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message
  .ResponseDetails.ResponseURL
anyURI Conditionally A URL that the recipient must visit to respond to a message. Responding may require logging into the eBay Web site.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Sender string Conditionally Display name of the eBay user that sent the message.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.SendToName string Conditionally Displayable name of the user or eBay application to which the message is sent. Only returned for M2M, and if a value exists.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Subject string Conditionally Subject of the message.

DetailLevel: ReturnHeaders, ReturnMessages.
Messages.Message.Text string Conditionally Contains the message content, and can contain a threaded message. This field can contain plain text or HTML, depending on the format of the original message. The API does not check the email-format preferences in My Messages on the eBay Web site.
Max length: 2 megabytes in size.

DetailLevel: ReturnMessages.
Summary MyMessagesSummaryType Conditionally Summary data for a given user's messages. This includes the numbers of new messages, flagged messages, and total messages. The amount and type of data returned is the same whether or not the request includes specific Message IDs. Always/Conditionally returned logic assumes a detail level of ReturnMessages.

DetailLevel: ReturnSummary.
Summary.FlaggedMessageCount int Conditionally The number of messages that have been flagged. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.FolderSummary MyMessagesFolderSummaryType Conditionally,
repeatable: [0..*]
Folder summary for each folder. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.FolderSummary.FolderID long Conditionally An ID that uniquely identifies a My Messages folder. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .FolderName
string Conditionally The name of a specified My Messages folder. For GetMyMessages, Inbox (FolderID = 0) and Sent (FolderID = 1) are not returned.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .NewAlertCount
int Conditionally This field has been deprecated, starting with the 685 release. Alerts are now synonymous with Flagged messages, and are added to the Summary.FlaggedMessageCount value.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .NewHighPriorityCount
int Conditionally The total number of new high priority messages that a given user has.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .NewMessageCount
int Conditionally The number of new messages in a given folder. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .TotalAlertCount
int Conditionally This field has been deprecated, starting with the 685 release. Alerts are now synonymous with Flagged messages, and are added to the Summary.FlaggedMessageCount value.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .TotalHighPriorityCount
int Conditionally The total number of high priority messages that a given user has.

DetailLevel: ReturnSummary.
Summary.FolderSummary
  .TotalMessageCount
int Conditionally The total number of messages in a given folder. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.NewHighPriorityCount int Conditionally The total number of new high priority messages that a given user has.

DetailLevel: ReturnSummary.
Summary.NewMessageCount int Conditionally The number of new messages that a given user has. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Summary.TotalHighPriorityCount int Conditionally The total number of high priority messages that a given user has.

DetailLevel: ReturnSummary.
Summary.TotalMessageCount int Conditionally The total number of messages for a given user. Always returned for detail level ReturnSummary.

DetailLevel: ReturnSummary.
Standard Output Fields  
Ack AckCodeType Always A token representing the application-level acknowledgement code that indicates the response status (e.g., success). The AckCodeType list specifies the possible values for the Ack field.

Applicable values:

CustomCode
(out) Reserved for internal or future use.
Failure
(out) This value indicates that the call request processing failed.
Success
(out) This value indicates that the call request was processed successfully without any issues.
Warning
(out) This value indicates that the call request was successful, but processing was not without any issues. These issues can be checked in the Errors container, that will also be returned when one or more known issues occur with the call request.

(Not all values in AckCodeType apply to this field.)

Code so that your app gracefully handles any future changes to this list.
Build string Always This refers to the specific software build that eBay used when processing the request and generating the response. This includes the version number plus additional information. eBay Developer Support may request the build information when helping you resolve technical issues.
CorrelationID string Conditionally Most Trading API calls support a MessageID element in the request and a CorrelationID element in the response. If you pass in a MessageID in a request, the same value will be returned in the CorrelationID field in the response. Pairing these values can help you track and confirm that a response is returned for every request and to match specific responses to specific requests. If you do not pass a MessageID value in the request, CorrelationID is not returned.

Note: GetCategories is designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, the MessageID and CorrelationID fields aren't applicable. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, MessageID and CorrelationID are applicable.
Errors ErrorType Conditionally,
repeatable: [0..*]
A list of application-level errors (if any) that occurred when eBay processed the request.

See Error Handling.

Errors.ErrorClassification ErrorClassificationCodeType Conditionally API errors are divided between two classes: system errors and request errors.

Applicable values:

CustomCode
(out) Reserved for internal or future use.
RequestError
(out) An error has occurred either as a result of a problem in the sending application or because the application's end-user has attempted to submit invalid data (or missing data). In these cases, do not retry the request. The problem must be corrected before the request can be made again. If the problem is due to something in the application (such as a missing required field), the application must be changed. If the problem is a result of end-user data, the application must alert the end-user to the problem and provide the means for the end-user to correct the data. Once the problem in the application or data is resolved, resend the request to eBay with the corrected data.
SystemError
(out) Indicates that an error has occurred on the eBay system side, such as a database or server down. An application can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form.

Code so that your app gracefully handles any future changes to this list.
Errors.ErrorCode token Conditionally A unique code that identifies the particular error condition that occurred. Your application can use error codes as identifiers in your customized error-handling algorithms. See the "Errors by Number" document.
Errors.ErrorParameters ErrorParameterType Conditionally,
repeatable: [0..*]
This optional element carries a list of context-specific error variables that indicate details about the error condition. These are useful when multiple instances of ErrorType are returned.
Errors.ErrorParameters
  [ attribute ParamID ]
string Conditionally This optional element carries a list of context-specific error variables that indicate details about the error condition. These are useful when multiple instances of ErrorType are returned.
Errors.ErrorParameters.Value string Conditionally This is the value of the request parameter noted in the ParamID attribute. So, if the ParamID value was ItemID, the value in this field would be the actual value of that ItemID.
Errors.LongMessage string Conditionally A more detailed description of the condition that raised the error.
Errors.SeverityCode SeverityCodeType Conditionally Indicates whether the error is a severe error (causing the request to fail) or an informational error (a warning) that should be communicated to the user.

Applicable values:

CustomCode
(out) Reserved for internal or future use.
Error
(out) The request that triggered the error was not processed successfully. When a serious application-level error occurs, the error is returned instead of the business data.

If the source of the problem is within the application (such as a missing required element), change the application before you retry the request.
  • If the problem is due to end-user input data, please alert the end-user to the problem and provide the means for them to correct the data. Once the problem in the application or data is resolved, you can attempt to re-send the request to eBay.
  • If the source of the problem is on eBay's side, An application can retry the request as-is a reasonable number of times (eBay recommends twice). If the error persists, contact Developer Technical Support. Once the problem has been resolved, the request may be resent in its original form.


See the Compatible Application Check section of the eBay Features Guide for more information.
Warning
(out) The request was processed successfully, but something occurred that may affect your application or the user. For example, eBay may have changed a value the user sent in. In this case, eBay returns a normal, successful response and also returns the warning.

When a warning occurs, the error is returned in addition to the business data. In this case, you do not need to retry the request (as the original request was successful). However, depending on the cause or nature of the warning, you might need to contact either the end user or eBay to effect a long term solution to the problem to prevent it from reoccurring in the future.

Code so that your app gracefully handles any future changes to this list.
Errors.ShortMessage string Conditionally A brief description of the condition that raised the error.
HardExpirationWarning string Conditionally Expiration date of the user's authentication token. Only returned within the 7-day period prior to a token's expiration. To ensure that user authentication tokens are secure and to help avoid a user's token being compromised, tokens have a limited life span. A token is only valid for a period of time (set by eBay). After this amount of time has passed, the token expires and must be replaced with a new token.
Timestamp dateTime Always This value represents the date and time when eBay processed the request. The time zone of this value is GMT and the format is the ISO 8601 date and time format (YYYY-MM-DDTHH:MM:SS.SSSZ). See the Time Values section in the eBay Features Guide for information about this time format and converting to and from the GMT time zone.

Note: GetCategories and other Trading API calls are designed to retrieve very large sets of metadata that change once a day or less often. To improve performance, these calls return cached responses when you request all available data (with no filters). When this occurs, this time value reflects the time the cached response was created. Thus, this value is not necessarily when the request was processed. However, if you specify an input filter to reduce the amount of data returned, the calls retrieve the latest data (not cached). When this occurs, this time value does reflect when the request was processed.
Version string Always The version of the response payload schema. Indicates the version of the schema that eBay used to process the request. See the Standard Data for All Calls section in the eBay Features Guide for information on using the response version when troubleshooting CustomCode values that appear in the response.



Detail Controls


DetailLevel

The DetailLevel input field influences which call-specific fields may be returned. (All standard output fields are returned regardless of DetailLevel.)

The none column indicates the fields that are returned when you do not specify a DetailLevel.

YThe field is always returned.
(Y)The field is conditionally returned. See the field documentation for clarification of conditions.
-The field is not returned.

Output Field ReturnHeaders ReturnMessages ReturnSummary
MessagesYY-
Messages.Message(Y)(Y)-
Messages.Message.Content-(Y)-
Messages.Message.ExpirationDate(Y)(Y)-
Messages.Message.ExternalMessageID(Y)(Y)-
Messages.Message.Flagged(Y)(Y)-
Messages.Message.Folder(Y)(Y)-
Messages.Message.Folder.FolderID(Y)(Y)-
Messages.Message.ItemID(Y)--
Messages.Message.MessageID(Y)(Y)-
Messages.Message.MessageMedia(Y)(Y)-
Messages.Message.Read(Y)(Y)-
Messages.Message.ReceiveDate(Y)(Y)-
Messages.Message.RecipientUserID(Y)(Y)-
Messages.Message.Replied(Y)(Y)-
Messages.Message.ResponseDetails(Y)(Y)-
Messages.Message.ResponseDetails.ResponseEnabled(Y)(Y)-
Messages.Message.ResponseDetails.ResponseURL(Y)(Y)-
Messages.Message.Sender(Y)(Y)-
Messages.Message.SendToName(Y)(Y)-
Messages.Message.Subject(Y)(Y)-
Messages.Message.Text-(Y)-
Summary--(Y)
Summary.FlaggedMessageCount--(Y)
Summary.FolderSummary--(Y)
Summary.FolderSummary.FolderID--(Y)
Summary.FolderSummary.FolderName--(Y)
Summary.FolderSummary.NewAlertCount--(Y)
Summary.FolderSummary.NewHighPriorityCount--(Y)
Summary.FolderSummary.NewMessageCount--(Y)
Summary.FolderSummary.TotalAlertCount--(Y)
Summary.FolderSummary.TotalHighPriorityCount--(Y)
Summary.FolderSummary.TotalMessageCount--(Y)
Summary.NewHighPriorityCount--(Y)
Summary.NewMessageCount--(Y)
Summary.TotalHighPriorityCount--(Y)
Summary.TotalMessageCount--(Y)



Samples

New to making API calls? Please see Making a Call.

Note: Some item IDs, user IDs, or other data in these samples might no longer be active on eBay. If necessary, you can substitute current eBay data in your requests.

Available samples:

Sample: Basic Call

Retrieves Message headers for the authenticated user.

Description

This sample shows how to retrieve the headers for messages. Once retrieved, you can cache the MessageID values, which you can use to get more details on specific messages with another GetMyMessages call.

Input

XML format.

<?xml version="1.0" encoding="utf-8"?>
<GetMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>ABC...123</eBayAuthToken>
  </RequesterCredentials>
  <WarningLevel>High</WarningLevel>
  <DetailLevel>ReturnHeaders</DetailLevel>
</GetMyMessagesRequest>

Output

XML format.
<GetMyMessagesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2016-02-19T17:46:17.619Z</Timestamp>
  <Ack>Success</Ack>
  <Version>655</Version>
  <Build>E655_CORE_BUNDLED_10639415_R1</Build>
  <Alerts/>
  <Messages>
    <Message>
      <Sender>bigbuyer</Sender>
      <RecipientUserID>magicalbookseller</RecipientUserID>
      <SendToName>magicalbookseller</SendToName>
      <Subject>bigbuyer has sent a question about item #110043598202,
          ending on Feb-18-16 18:52:35 PST - Acura : CL</Subject>
      <MessageID>1095480</MessageID>
      <ExternalMessageID>763010</ExternalMessageID>
      <Flagged>false</Flagged>
      <Read>false</Read>
      <ReceiveDate>2016-02-12T02:54:32.000Z</ReceiveDate>
      <ExpirationDate>2017-02-12T02:54:31.000Z</ExpirationDate>
      <ItemID>110043598202</ItemID>
      <ResponseDetails>
        <ResponseEnabled>true</ResponseEnabled>
        <ResponseURL>http://contact.sandbox.ebay.com/ws/eBayISAPI.dll?M2MContact&
            item=110043598202&requested=bigbuyer&qid=763010&redirect=0&messageid=m1095480</ResponseURL>
      </ResponseDetails>
      <Folder>
        <FolderID>0</FolderID>
      </Folder>
      <Replied>false</Replied>
    </Message>
    <Message>
      <Sender>bountifulbuyer</Sender>
      <RecipientUserID>magicalbookseller</RecipientUserID>
      <SendToName>magicalbookseller</SendToName>
      <Subject>bountifulbuyer has sent a question about :Question about book Edition for item #110043547115,
          ending on Feb-16-16 15:45:13 PST - Harry Potter and the Philosopher's Stone</Subject>
      <MessageID>1095270</MessageID>
      <ExternalMessageID>762802</ExternalMessageID>
      <Flagged>false</Flagged>
      <Read>false</Read>
      <ReceiveDate>2016-02-10T18:03:43.000Z</ReceiveDate>
      <ExpirationDate>2017-02-10T18:03:43.000Z</ExpirationDate>
      <ItemID>110043547115</ItemID>
      <ResponseDetails>
        <ResponseEnabled>true</ResponseEnabled>
        <ResponseURL>http://contact.sandbox.ebay.com/ws/eBayISAPI.dll?M2MContact&
            item=110043547115&requested=bountifulbuyer&qid=762802&redirect=0&messageid=m1095270</ResponseURL>
        <UserResponseDate>2016-02-10T18:51:33.000Z</UserResponseDate>
      </ResponseDetails>
      <Folder>
        <FolderID>0</FolderID>
      </Folder>
      <Replied>true</Replied>
    </Message>
  </Messages>
</GetMyMessagesResponse>

Back to list of samples

Sample: Specific Message IDs

Retrieves specific Messages, according to the provided message ID values.

Description

Retrieve a summary of your messages by calling GetMyMessages with DetailLevel set to ReturnHeaders. Make a second call to GetMyMessages with DetailLevel set to ReturnMessages, and specify the message IDs of the messages you want to review. This returns detailed information for each specified message.

Input

You can specify up to to 10 MessageID values per request.

XML format.

<?xml version="1.0" encoding="utf-8"?> 
<GetMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents"> 
  <Version>467</Version> 
  <DetailLevel>ReturnMessages</DetailLevel> 
  <RequesterCredentials> 
    <eBayAuthToken>123...ABC</eBayAuthToken> 
  </RequesterCredentials> 
  <MessageIDs> 
    <MessageID>2848093</MessageID> 
  </MessageIDs> 
</GetMyMessagesRequest> 

Output

Notice that the response contains HTML within the Text node.

XML format.
<?xml version="1.0" encoding="UTF-8"?>
<GetMyMessagesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2006-06-22T21:37:44.984Z</Timestamp>
  <Ack>Success</Ack>
  <Version>465</Version>
  <Build>e465_core_Bundled_3107419_R1</Build>
  <Messages>
    <Message>
      <Sender>eBay</Sender>
      <RecipientUserID>sampleseller</RecipientUserID>
      <Subject>eBay Offer Submitted: Austin Healey</Subject>
      <MessageID>2848093</MessageID>
      <Text>
        <html>
          <head>
            <title>eBay Offer Submitted: Austin Healey</title>
          </head>
          <body bgcolor="#FFFFFF">
            <table cellpadding="0" cellspacing="0" width="100%">
              <tr>
                <td width="100%" style="word-wrap: break-word;">
                  <table cellpadding="0" cellspacing="0" border="0" class="BodyFont"
                    width="100%">
                    <tr>
                      <td><img src="http://pics.qa.ebaystatic.com/aw/pics/logos/
                        ebay_95x39.gif" alt="eBay"/></td>
                      <td valign="bottom" align="left" class="Help"><b>eBay sent this
                        message to Sample Seller (sampleseller).</b>
                      <br/>
Your registered name is included to show this message originated from eBay. <a
href="http://pages.ebay.com/help/confidence/name-userid-emails.html">Learn more</a>.
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </body>
        </html>
      </Text>
      <Flagged>false</Flagged>
      <Read>false</Read>
      <ReceiveDate>2006-06-21T14:17:27.000Z</ReceiveDate>
      <ExpirationDate>2006-08-20T14:17:04.000Z</ExpirationDate>
      <ResponseDetails>
        <ResponseEnabled>false</ResponseEnabled>
      </ResponseDetails>
      <Folder>
        <FolderID>0</FolderID>
      </Folder>
    </Message>
  </Messages>
</GetMyMessagesResponse>


Back to list of samples

Sample: Message Folders

Retrieves message headers for the specified folder.

Description

If you get too much data when retrieving only message headers, you can further restrict the amount of data returned by specifying a FolderID in the request. Doing so returns only the message headers from the specified folder.

Retrieve the FolderID values for the My Messages folders by calling GetMyMessages with a DetailLevel of ReturnSummary. Note that the FolderID for the Inbox is 0.

Input

This example uses a FolderID of 2.

XML format.

<?xml version="1.0" encoding="utf-8"?> 
<GetMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents"> 
  <Version>467</Version> 
  <DetailLevel>ReturnMessages</DetailLevel> 
  <RequesterCredentials> 
    <eBayAuthToken>123...ABC</eBayAuthToken> 
  </RequesterCredentials> 
  <FolderID>2</FolderID> 
</GetMyMessagesRequest> 

Output

The following sample shows the results from this call. Notice that the message is from FolderID 2.

XML format.
<?xml version="1.0" encoding="utf-8"?>
<GetMyMessagesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2006-06-27T00:48:48.734Z</Timestamp>
  <Ack>Success</Ack>
  <Version>465</Version>
  <Build>e465_core_Bundled_3107419_R1</Build>
  <Alerts/>
  <Messages>
    <Message>
      <Sender>eBay</Sender>
      <RecipientUserID>sampleuser</RecipientUserID>
      <Subject>eBay Second Chance Offer for Item #330000037619: Auction Title</Subject>
      <MessageID>2809419</MessageID>
      <Flagged>false</Flagged>
      <Read>false</Read>
      <ReceiveDate>2006-06-20T23:34:37.000Z</ReceiveDate>
      <ExpirationDate>2006-07-20T23:34:30.000Z</ExpirationDate>
      <ResponseDetails>
        <ResponseEnabled>true</ResponseEnabled>
        <ResponseURL>http://respondtothis.com</ResponseURL>
      </ResponseDetails>
      <Folder>
        <FolderID>2</FolderID>
      </Folder>
    </Message>
  </Messages>
</GetMyMessagesResponse>


Back to list of samples



Change History

Change Date Description
743
2011-10-12
  • MessageType.ClassifiedsBestOffer (added): Indicates that a best offer has been made on the seller's corresponding classified ad listing.
  • MessageType.ClassifiedsContactSeller (added): Indicates that an inquiry has been sent to the seller regarding the corresponding classified ad listing.
677
2010-07-07
  • IncludeHighPriorityMessageOnly (added): Element newly available in Sandbox only.
  • Pagination (added): Element newly available in Sandbox only.
661
2010-03-17
  • Various (modified): The documentation has been updated to state that Alerts are now treated as flagged messages. Data formerly in the Alerts container now is returned in the Messages container, and the Alerts container is empty.
657
2010-02-17
  • Messages.Message.Text (doc change): The documentation has been updated to state that the content of the field can contain up to 2 MB of data.
635
2009-09-16
  • Messages.Message.Text (modified): Threaded messages are returned. Additionally, emails that were sent by an eBay member's email client (to another eBay member) are returned; their message type is indicated as MessageTypeCodeType.ContacteBayMemberViaAnonymousEmail.
583
2008-09-17
  • Messages.Message.QuestionType.None (added): New value indicating that no question type applies.
573
2008-07-09
  • Messages.Message.ListingStatus (added): Specifies the listing status at the time the question was created.
  • Messages.Message.MessageType (added): Available on the US site as of September 2009. Specifies the type of message being retrieved through GetMyMessages.
  • Messages.Message.QuestionType (added): Available on the US site as of September 2009. Specifies the context of the question, and corresponds to the subject of the message.
  • Messages.Message.ExternalMessageID (added): Available on the US site as of September 2009. An ID used by an external application to uniquely identify a message.
  • Messages.Message.Content (added): The message body. This can be plain text.
479
2006-09-20
  • Messages.Message.Folder (doc change): Messages.Message.Folder is conditionally returned.
445
2006-1-25
  • Messages.Message.SendToName (added): A new value is returned, the displayable name of the user or eBay application to which the message is sent. Only returned for M2M, and if a value exists.
439
2005-12-28
  • Alerts.Alert.ResponseDetails.ResponseEnabled (added): Indicates whether or not an alert or message can be responded to. To respond to an alert or message, use the URL in ResponseURL. You may need to log into the eBay Web site to complete the response.
  • Messages.Message.ResponseDetails.ResponseEnabled (added): Indicates whether or not an alert or message can be responded to. To respond to an alert or message, use the URL in ResponseURL. You may need to log into the eBay Web site to complete the response.