Most of the API calls require an authenticated Memsource user. The APIs do not use any special user accounts. Each API can be called on behalf of any existing user (using their username and password). Before calling any API that requires an authenticated user, you have to call auth/login API to obtain an authentication token. Such a token is valid for 24 hours and can be used for all subsequent calls (please, do not acquire a new token for every call). Use the obtained token as a query parameter 'token' in following API calls.
OAuth 2.0 can be set and managed in Memsource Cloud Setup > Integration
Asynchronous APIs should always be preferred to their synchronous counterparts. If you call synchronous APIs, there is a chance of receiving timeout expired responses when processing large batches of files or even a single huge file. Synchronous APIs should only be used for small files and small scale integration with Memsource.
After you call an asynchronous API, you will receive an instant response including the identifier request. You will use this identifier to check the status of the request by calling getAsyncRequest and checking asyncResponse field. This polling approach can lead to a number of getAsyncRequest calls before you actually receive asyncResponse as not null.
As a response to the drawbacks of the polling approach to asynchronous requests, we have introduced support for callbacks in all asynchronous APIs. When calling an asynchronous request, you specify a URL (in callbackUrl parameter) that will be requested from our side just after the work initiated by the asynchronous request is finished.
Callbacks are requested via HTTP POST calls and the data is passed on in the body encoded as JSON. The JSON object always contains
- information about the asynchronous request (same as when calling getAsyncRequest),
- detailed information about the result of the action (for example a full analysis or jobs details).
If the callback URL is not accessible, the request will be repeated from our side after 2 minutes, then 4 minutes, 8 minutes, 16 minutes, and then after 30 minutes up to a total number of 10 retries.
Your callback URL must respond with the 200 OK HTTP status code to be considered successful on our side.
For an overview of the Memsource REST API, see this introductory article.