Authentication
All Su API requests need to be authenticated through the authorization header. The Su APIs offer only basic authentication methods.
Authorization
Authorization involves sending credentials (username
and password
) and app-id
with every API request. Here's how it works:
Encoding Credentials
Your username and password are encoded in Base64 format and separated by a colon (
:
).For example,
username:password
becomesdXNlcm5hbWU6cGFzc3dvcmQ=
in Base64.
Adding to Header
The encoded credentials are added to the request header after the word "Basic". Example:
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Usage Example
When making an API request to generate API keys, you include the
Authorization
header and your unique app ID provided by Su.
Example header
Authorization: Basic ZTZjTk80S1U6VjBEN1NxSGo
app-id: dWF0c3Uuc3RhYWgubmV0
Su Partner Supply API Authentication
The Su Partner Supply API authentication process validates the identity of the client attempting to make a connection by using an authentication protocol. The system needs to make sure each end user is properly validated.
Your API keys carry many privileges, so be sure to keep them secure. Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
All requests to the Su REST API need to be authenticated. The Su API supports the HTTP basic authentication scheme for the Partner Supply APIs. For each request, you must include an authorization header.
Partners can opt for their own domain for live production. STAAH requires an SSL certificate for the domain that is valid for the next 2 years at least.
Authorization: Basic {Authorization String}
Encoding
Encoding provides a specific mechanism for handling text in various available character encodings. The Partner Supply API uses UTF-8 encoding for the JSON body for all API requests and responses.
Authentication Failure
An API failure is any response that does not confirm to the system’s expected behavior when invoked by the client. If a call fails authentication, the API returns HTTP status code 401. See below:
Authentication Failure Error
{
"Status": "Fail",
"Errors": {
"Code": "497",
"ShortText": "Authorization Required"
}
}
Last updated
Was this helpful?