Skip to main content
Published: April 27 2010, 6:06:00 AMUpdated: November 28 2020, 8:21:50 PM

Retrieving Client Alerts session information is not working properly. The "Login" call often fails with "Invalid ClientAlerts Auth Token" error, even though the client alerts token is valid.


Summary


Once you receive <ClientAlertsAuthToken> data in the response, it needs to be URL-encoded to escape special characters like "+", "=", space etc., before you can use it as a parameter in the "Login" request.



Detailed Description 

After you URL-encode the Client Alerts Auth Token, it can be safely sent over as a URL param in the "Login" call. It is always a good practice to URL-encode the parameters that are sent as URL params.

Here is an example:

Step 1:  Retrieve Client Alerts Auth token

REQUEST:

<?xml version="1.0" encoding="utf-8"?>
<GetClientAlertsAuthTokenRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>INSERT_YOUR_AUTH_TOKEN_HERE</eBayAuthToken>
  </RequesterCredentials>
  <ErrorLanguage>en_US</ErrorLanguage>
  <WarningLevel>High</WarningLevel>
</GetClientAlertsAuthTokenRequest>

RESPONSE:

<?xml version="1.0" encoding="utf-8"?>
<GetClientAlertsAuthTokenResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2010-04-19T09:30:05.002Z</Timestamp>
  <Ack>Success</Ack>
  <Version>665</Version>
  <Build>E665_CORE_BUNDLED_11051309_R1</Build>
  <ClientAlertsAuthToken>AQAAASf+w9gAAA0xfDE3NDY5MzY1fDUyMTM0fDEyNzIyNzQyMDUwMDJ8MDNpdHNSdXlwTTJRT2tzZFVqbDBSZFBPaVhETEVoZW84TXEyalNZbHVZY3dYMyt5Mng2djJ0K3AyRjBaQVpIVXh3SWxmS2MrY1NQVjJQeElQc0tsMmc9PVkHabaISHALa6Sv2CNP81isAKhA</ClientAlertsAuthToken>
   <HardExpirationTime>2010-04-26T09:30:05.002Z</HardExpirationTime>
</GetClientAlertsAuthTokenResponse>

Step 2: URL-encode the <ClientAlertsAuthToken> retrieved in Step 1

Retrieved Token:
AQAAASf+w9gAAA0xfDE3NDY5MzY1fDUyMTM0fDEyNzIyNzQyMDUwMDJ8MDNpdHNSdXlwTTJRT2tzZFVqbDBSZFBPaVhETEVoZW84TXEyalNZbHVZY3dYMyt5Mng2djJ0K3AyRjBaQVpIVXh3SWxmS2MrY1NQVjJQeElQc0tsMmc9PVkHabaISHALa6Sv2CNP81isAKhA

Token after encoding:
AQAAASf%2Bw9gAAA0xfDE3NDY5MzY1fDUyMTM0fDEyNzIyNzQyMDUwMDJ8MDNpdHNSdXlwTTJRT2tzZFVqbDBSZFBPaVhETEVoZW84TXEyalNZbHVZY3dYMyt5Mng2djJ0K3AyRjBaQVpIVXh3SWxmS2MrY1NQVjJQeElQc0tsMmc9PVkHabaISHALa6Sv2CNP81isAKhA

Note that after URL encoding, the "+" symbol in the token is encoded as %2B

Step 3: Establish a Client Alerts session by passing in the Client Alerts token and retrieving session information

REQUEST:

http://clientalerts.ebay.com/ws/ecasvc/ClientAlerts?version=665&appid=YOUR_APP_ID_HERE&callname=Login&ClientAlertsAuthToken=AQAAASf%2Bw9gAAA0xfDE3NDY5MzY1fDUyMTM0fDEyNzIyNzQyMDUwMDJ8MDNpdHNSdXlwTTJRT2tzZFVqbDBSZFBPaVhETEVoZW84TXEyalNZbHVZY3dYMyt5Mng2djJ0K3AyRjBaQVpIVXh3SWxmS2MrY1NQVjJQeElQc0tsMmc9PVkHabaISHALa6Sv2CNP81isAKhA


Additional Resources

Client Alerts API Guide: http://developer.ebay.com/DevZone/client-alerts/docs/Concepts/ClientAlertsAPIGuide.html 

How well did this answer your question?
Answers others found helpful