The Afinis sandbox is an isolated test environment where you can try out the standardized APIs. Below are instructions on how to make your first API call within this sandbox, or an API REST tool like Postman (see below). A sample set of data is available for each API to allow you to simulate an API call in a production environment.
API Calls
A series of fields are enabled to customize the call for each API. All API calls are structured with the following components:
Resource URL
Header Parameters
Try it out!
Some APIs will also include a Query Parameter.
Return Codes
The API will always return an HTTP STATUS. The table below summarizes the general response codes that are returned in the APIs.
Code |
Description |
2XX |
The API call was successful. |
4XX |
The API call had an error. The error will be encoded in the body of the response. |
5XX |
The API call was unsuccessful. You should retry later. |
Specific Return Codes
HTTP Code |
Description |
|
400 |
Bad request |
The request could not be understood or required parameters were missing |
|
2000 |
Invalid JSON Structure |
|
2001 |
“Field name” is missing or invalid |
|
2002 |
Invalid date |
|
2003 |
Invalid combination of fields submitted. Check the API specification for eligible combinations |
|
2004 |
“Field name” cannot be more than [max] characters |
401 |
Unauthorized |
Authentication failed or user doesn’t have permissions for requested operation |
|
1000 |
API key is missing, invalid or expired |
|
1001 |
API token is invalid, expired, or account associated with key does not have access to that API |
403 |
Forbidden |
Access denied, the operation is not allowed |
404 |
Not Found |
Resource was not found. |
405 |
Method Not Allowed |
The request method is known by the server but has been disabled and cannot be used. |
406 |
Invalid Accept |
Web server doesn't find any content that conforms to the criteria given by the user agent. |
415 |
Content Type |
The media format of the requested data is not supported by the server, so the server is rejecting the request. |
422 |
4001 |
Unprocessable request due to "%%" |
500 |
3001 |
Internal server error |
503 |
Service Unavailable |
Service is temporarily unavailable |
API Testing
Select the API that you want to test:
Real-Time Billing Account Validation
Request Proof of Authorization
Try it out!
Set API Key information as previously provided in the Getting Started page.
Insert the following information in the open dialogue box:
- Name = "apikey" (all lowercase)
- Set value copied from the “Consumer Key” (make sure there is no space before or after the string of characters)
- Select “Query”
After customizing the call components, click the “SEND” button to execute the API call. The “RESET” button will reset all the fields to the ones used by default.
Postman
In this section, we take a look at how to make direct HTTP requests by using Postman. If you are new to Postman, see the Postman documentation and tutorials.
For a GET request like Bank Contact API insert the Resource URL and set the Consumer Key “?apikey=” with the appropriate credentials, followed by the reason i.e., “&reason=ACH_FRAUD” as shown below:
For a POST request like Account Validation, information has to be passed in the header and the body of the HTTP request (changing the values as required) as shown below.
The header includes the Resource URL and Consumer Key with raw json content sent in the request body.
*NOTE: In order to send json in the request body, select the radio button raw and set the text to “JSON(application/json).”