Most API calls require an authenticated user. The APIs do not use any special user profiles. Each API can be called on behalf of any existing user using their username and password.
Token
Before calling any API that requires an authenticated user, call the auth/login API to obtain an authentication token. The token is valid for 24 hours and can be used for all subsequent calls. Do not create a new token for every call.
In subsequent API calls, the obtained token is used in the Authorization
header. The header value field is introduced with ApiToken
followed by a space and the token itself.
Example:
OAuth 2.0
Use OAuth 2.0 in applications instead of sending tokens with each call.
To establish the OAuth 2.0 connection, follow these steps:
-
From the Settings
page, scroll down to the section and click on Registered OAuth Apps.
The
page opens. -
Click New.
The
page opens. -
Provide a
, (Callback) and an optional . -
Click Save.
The
page opens with the new connection in the list and an associated .The ID is used in the application that connects to Phrase to establish the connection. It is stored in the database and is used to pair requests with the proper requester.
-
Use these URLs with the generated Client ID for authorization:
-
Auth URL
https://cloud.memsource.com/web/oauth/authorize
-
Token URL
https://cloud.memsource.com/web/oauth/token
If your profile is located in the US DataCenter, add us before cloud.memsource.com, for example https://us.cloud.memsource.com/web/oauth/authorize
-
-
When authorizing, use the Administrator profile to log in and click Allow.
The application is now linked and the authentication API call will not be required.