Find the answer to your question
Advanced Search
I am getting invalid MessageID when make DeleteMyMessages API call.
Both GetMemberMessages or GetMyMessages API return MessageID, should I use the MessageID returned in GetMemberMessages or GetMyMessages API ?
Summary
DeleteMyMessages API allows you to remove upto 10 Messages and/or Alterts in each request. You should plug the MessageID or AlertID returned in GetMyMessages API into DeleteMyMessages API request. To make GetMyMessages call with a detail level of ReturnHeaders as below, you can obtain all the MessageIDs and AlertIDs:
<?xml version="1.0" encoding="utf-8"?>
<GetMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>571</Version>
<DetailLevel>ReturnHeaders</DetailLevel>
<RequesterCredentials>
<eBayAuthToken></eBayAuthToken>
</RequesterCredentials>
</GetMyMessagesRequest>
For example, GetMyMessages request above returns a MessageID 17448439402 as:
<?xml version="1.0" encoding="UTF-8" ?>
- <GetMyMessagesResponse xmlns="urn:ebay:apis:eBLBaseComponents">
<Timestamp>2008-07-23T23:52:25.007Z</Timestamp>
<Ack>Success</Ack>
<Version>573</Version>
<Build>e573_intl_Bundled_6914842_R1</Build>
<Alerts />
- <Messages>
- <Message>
<Sender>eBay</Sender>
<RecipientUserID>xxxx</RecipientUserID>
<Subject>You've received an offer for your eBay item, Toyota : Camry</Subject>
<MessageID>17448439402</MessageID>
<Flagged>false</Flagged>
<Read>false</Read>
<ReceiveDate>2008-07-23T23:25:11.000Z</ReceiveDate>
<ExpirationDate>2008-08-22T23:25:11.000Z</ExpirationDate>
- <ResponseDetails>
<ResponseEnabled>false</ResponseEnabled>
</ResponseDetails>
- <Folder>
<FolderID>0</FolderID>
</Folder>
</Message>
...
</Messages>
</GetMyMessagesResponse>
Then, the DeleteMyMessages request can be constructed as:
<?xml version="1.0" encoding="utf-8"?>
<DeleteMyMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<Version>571</Version>
<RequesterCredentials>
<eBayAuthToken>xxx</eBayAuthToken>
</RequesterCredentials>
<MessageIDs>
<MessageID>17448439402</MessageID>
</MessageIDs>
</DeleteMyMessagesRequest>
NOTE. Unresolved Alerts cannot be deleted.