Here is a step-by-step guide on how to make your first request to the Sell API. We will provide your authentication details by returning a token using your login credentials. We will make this request through the Users API using the Retrieve an authenticating user endpoint.
In the Access Tokens section, click the + Add User Token button.
Fill in the Description field and click the Save button.
At this point you should see a modal window with your newly-generated access token.
From the modal window, copy the access token and store it for further use, as it will be required during your first call.
2. Make an API call
At this point, we are ready to make a request. We have a valid access token and we know the endpoint we are going to hit in order to retrieve your authenticating user:
To authenticate to the Sell API, we will use the standard Authorization header, using the Bearer authentication schema to transmit the access token. Details on authenticating to our resource servers can be found in the Accessing Protected Resources article. We use the following syntax:
Authorization: Bearer $ACCESS_TOKEN
Our API is understood by any off-the-shelf HTTP client, but in this case we will use the curl command line tool.
The way to do this with curl is to use:
the -X flag, which specifies a custom request method. In our case it is the GET method ( -X GET ).
the -H flag, which is used to include an extra header in the request when sending HTTP to a server. In our case we want a JSON response. This is done by using the Accept header and setting its value to application/json ( -H "Accept: application/json").