Authentication
The Argyle API uses HTTP Basic Auth. The username is yourapi_key_id and the password is your api_key_secret.
- Find your
api_key_idandapi_key_secretin Argyle Console. - If invalid credentials are provided, a 401 Unauthorized response code is returned with the corresponding JSON body.
- You must use different credentials depending on the environment you are in. If credentials for the wrong environment are used, a 401 Unauthorized response code is returned with the corresponding JSON body.
To protect your credentials from being revealed on the client-side, invoke the Argyle API from your own server-side applications only.
API authentication:
Possible error responses:
Possible error responses:
Environments
Argyle API operates in two separate environments:- Production
- Sandbox
In the sandbox environment, you can only use the credentials provided below and in the Link Emulator. These are test work accounts.
apiHost to point to the sandbox API endpoint.
Find more information on how to configure Link in our Link Configuration Reference.
API Environment URLs:
https://api-sandbox.argyle.com/v1https://api.argyle.com/v1
Sandbox credentials:
| Bob | Sarah | Joe | |
|---|---|---|---|
| test1@argyle.com | test2@argyle.com | test3@argyle.com | |
| Username | test_1 | test_2 | test_3 |
| Password | passgood | passgood | passgood |
| Verification code | 8081 | 8082 | 8083 |
| Phone number | (800) 900-0010 | (800) 900-0020 | (800) 900-0030 |
| Driver’s license # | D1230010 | D1230020 | D1230030 |
- Rideshare/Delivery — if you select a gig company like Uber or Doordash, the data has more activity information (duration, distance, etc).
- General — if you select any other company or payroll platform, the data reflects traditional employment records.
When running in a Sandbox environment, you can connect work accounts with the provided sandbox credentials only.
Inactive sandbox accounts are automatically deleted 60 days after creation.
Security
Follow these best practices to secure your API keys:- Do not embed API keys directly in code. API keys that are embedded in code can be accidentally exposed to the public. For example, you may forget to remove the keys from code that you share. Instead of embedding your API keys in your applications, store them in environment variables or in files outside of your application’s source tree.
- Do not store API keys in files inside your application’s source tree. If you store API keys in files, keep the files outside your application’s source tree to help ensure your keys do not end up in your source code control system. This is particularly important if you use a public source code management system such as GitHub.
- Review your code before publicly releasing it. Ensure that your code does not contain API keys or any other private information before you make your code publicly available.
- Delete unneeded API keys to minimize exposure to attacks.
- Limit one API key pair’s usage to a specific system of your platform backend. This limits the scope of each key. If an API key is compromised, you can delete or regenerate the impacted key without needing to update your other API keys.
Errors
In case of an error, an appropriate HTTP response code is sent. The JSON object in the response body contains a single keydetail that has a description of an error.
| Status code | Description |
|---|---|
| 200 - OK | The request succeeded. |
| 201 - Created | The request succeeded and a new resource was created. |
| 204 - No Content | The request succeeded and no content was returned. |
| 400 - Bad Request | The request was invalid and could not be processed. |
| 401 - Unauthorized | Invalid API keys were provided. |
| 402 - Request Failed | The request was valid but could not be processed. |
| 403 - Forbidden | The API keys provided do not have the necessary permissions required to perform the request. |
| 404 - Not Found | The requested resource could not be found. |
| 409 - Conflict | The request conflicts with the server state and could not be processed. |
| 429 - Too Many Requests | Too many requests were sent in a given amount of time. See rate limiting. |
| 500, 502, 503, 504 - Server Errors | The request failed due to errors on Argyle servers. |
Field validation error response:
Null values
Sometimes in the API call response, you seenull as the returned value for a given field. This can happen for one of two reasons:
- The data source does not support that field (i.e. it does not hold that information).
- The field is supported by the data source but the data in it is not present. This could happen due to optional fields, inactive accounts, etc.
Example profile object:
Pagination
All top-level API resources have support for bulk fetches via “list” API methods. For instance, you can list payouts, list documents, etc. Each of the responses hasnext and previous page URLs provided for easier querying of the next and previous results pages. You can use the limit parameter to define the number of results on a page.
If for example you have 900 connected users, after calling GET https://api-sandbox.argyle.com/v1/users?limit=200 you will receive a response that lists 200 users. At the top of the response is the next URL:
https://api-sandbox.argyle.com/v1/users?cursor=cD0yABCyLTA5LTI2KzEzJTNBBTMlM0E1OC4yNTUwMjYlMkIwMCUzQTAw&limit=200 (the URL of the next field).
- When retrieving resources in bulk, make sure to follow the
nextandpreviouspage URLs to avoid retrieving the same resource multiple times and eliminate redundant calls. Following the URLs means no two requests can happen in parallel — this is by design as it helps to avoid 429: Rate Limiting responses and retrieving the data can be done in a much more efficient stream-like manner. - In case you want to achieve more throughput, try utilizing concurrency by fetching data from multiple users in parallel.
Pagination arguments:
limit (integer) — Optional. The number of objects to be returned. The default value is 10. The maximum value is 200.
List response object:
next (string) — The URL to request the next page. The returned value is null if this is the last page.
previous (string) — The URL to request the previous page. The returned value is null if this is the first page.
results (array of objects) — An array containing the resources requested.
Example — List Link items:
Rate limiting
The Argyle API employs a number of safeguards against bursts of incoming traffic to help maximize its stability. If you send many requests in quick succession you may see error responses that show up as status code429 (Too Many Requests). In this case, you need to put that request back into a queue to retry with an exponential backoff.
The Argyle API allows a rate of 50 RPS (requests per second).
Running a large volume of closely-spaced requests can lead to rate limiting. Often this can occur as part of an analytical or a migration operation.