User Account Details

Many of the subscriber-specific APIs require a unique user or subscriber id as input.  The User Authentication (login) API does not return the unique id, so a subsequent API call is needed to get that information.

Account Details API

The Account Details API will return the internal unique id for an authenticated user.  This is a secured API meaning it requires an Authorization Header to pass an authentication token.  In this case, the token should be a User Authentication Token like that returned from the User Authentication process.  There are no other arguments to this API.

You can get the user Id by making a GET request to https://{{Client-Specific-Domain}}/appservices/api/v2/accounts.  You must supply an Authorization header representing a bearer token.  The token passed in should be a user authentication token (Not your application authentication token). An example request is shown below.

curl --location --request GET 'https://subscribe.acmenews.com/appservices/api/v2/accounts/' \
--header 'Authorization: Bearer NtT7UltuXJBwc7l9p9P2yMNGq0Vjz49EbYuAvyWb--pgPJ-xh-9TjRhPpM1QTMWBJKx'
Click to copy

The API returns a JSON response similar to the following:

{
    "userId": "3262342",
    "email": "[email protected]"
}
Click to copy

The current version of the Account Details API only returns the user id and the user's email address.  This may change in the future.  You need to capture and save the returned user id for use in subsequent API calls.

An invalid bearer token will result in a 401-Unauthorized response.  This is true if the token is expired or if you use an invalid token (i.e., you use your application authentication token instead of a user authentication token)