Developers Program

Client Alerts Login Request fails with "Invalid ClientAlerts Auth Token"

Published: April 27 2010, 6:06:00 AMยทUpdated: September 07 2022, 1:18:49 PM

Products

Question

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.

Answer


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>2022-09-07T20:10:59.819Z</Timestamp>
<Ack>Success</Ack>
<Version>1173</Version>
<Build>E1173_CORE_APINOTIFY_19146596_R1</Build>
<ClientAlertsAuthToken>AQAAAYL2WPAAAA0xfDEzMjg0NzczM3w3MzI2M3wxNjYzMTg2MjU5Nzg2fHVNY0V2VmhwTU5xTGV1YUZQMDVSWWQxeERmVXhjWmJlWGVEMDBLR3BaeFhBUU1VdS9QVTdHTzlhSXFXTWpPU0FjVDhyVjRyWnVHVE9WUGRxeFpHcHFnPT2lVnATfzq0HfP0hNgLD/OvolhnLw==</ClientAlertsAuthToken>
<HardExpirationTime>2022-09-14T20:10:59.786Z</HardExpirationTime>
</GetClientAlertsAuthTokenResponse>

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

Retrieved Token:
AQAAAYL2WPAAAA0xfDEzMjg0NzczM3w3MzI2M3wxNjYzMTg2MjU5Nzg2fHVNY0V2VmhwTU5xTGV1YUZQMDVSWWQxeERmVXhjWmJlWGVEMDBLR3BaeFhBUU1VdS9QVTdHTzlhSXFXTWpPU0FjVDhyVjRyWnVHVE9WUGRxeFpHcHFnPT2lVnATfzq0HfP0hNgLD/OvolhnLw==

Token after encoding:
AQAAAYL2WPAAAA0xfDEzMjg0NzczM3w3MzI2M3wxNjYzMTg2MjU5Nzg2fHVNY0V2VmhwTU5xTGV1YUZQMDVSWWQxeERmVXhjWmJlWGVEMDBLR3BaeFhBUU1VdS9QVTdHTzlhSXFXTWpPU0FjVDhyVjRyWnVHVE9WUGRxeFpHcHFnPT2lVnATfzq0HfP0hNgLD%2FOvolhnLw%3D%3D

Note that after URL encoding, the "/" and the "=" symbols in the token are encoded as %2F and %3D respectively


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=1235&appid=YOUR_APP_ID_HERE&callname=Login&ClientAlertsAuthToken=AQAAAYL2WPAAAA0xfDEzMjg0NzczM3w3MzI2M3wxNjYzMTg2MjU5Nzg2fHVNY0V2VmhwTU5xTGV1YUZQMDVSWWQxeERmVXhjWmJlWGVEMDBLR3BaeFhBUU1VdS9QVTdHTzlhSXFXTWpPU0FjVDhyVjRyWnVHVE9WUGRxeFpHcHFnPT2lVnATfzq0HfP0hNgLD%2FOvolhnLw%3D%3D

Additional Resources

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

How well did this answer your question?