Testing the APIs
The ASIG 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. |
422 |
4001 |
Unprocessable request due to "%%" |
500 |
3001 |
Internal server error |
503 |
Service Unavailable |
Service is temporarily unavailable |
Account Validation Specific Return Codes
Code |
Description |
|
200 |
Account Status - Enabled |
The request was successful. |
Account Status - Disabled |
The request was successful. |
API Testing
Select the API that you want to test:
Bank Contact API Test Data
Use the sample bank contact test data below to test varying outcomes. The data with the positive response has been preloaded into the sandbox.
Bank Contact Test Account Data |
|||||
(Bank ID) |
Name |
Phone Number |
|
Contact Type |
Response |
061103852 |
John Q. Public |
555-123-5678 |
ACH_FRAUD |
Positive |
|
061103853 |
Jane Smith |
555-123-5679 |
ACH_FRAUD |
Negative |
|
061103852 |
John Q. Public |
555-123-5678 |
WIRE_FRAUD |
Negative |
Follow the instructions provided for the specific API test components and use the highlighted areas to populate the relevant fields.
Resource URL
Resource URL needs to be customized for the Bank Contact API. If you hover your mouse over bankid, you will find an explanation of the field. Edit and insert a 9-digit value in the Resource URL.
Set the Query Parameter with the reason for inquiry.
Header Parameter
Select “application/json” in the drop down menu for Content-Type for the Header Parameter.
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.
Response
A positive API call will return a JSON that contains the information about the bank contact:
If you test a call that does not include one or more of the required values, or if you test a call that provides an invalid value, you’ll receive the appropriate error response. When there is a 4XX error, additional description will help debug errors.
Example of an error response with an incorrect bank ID (i.e., bank transit routing number):
An error response for an invalid inquiry request e.g., WIRE_FRAUD:
Account Validation API Test Data
Account Validation test data is provided below with a variety of realistic account information. This data has been preloaded into the sandbox and should all return a successful account validation outcome of 200 OK – Enabled or 200 OK – Disabled if used correctly in the API.
Positive Responses:
|
API Call |
Routing Transit (member identification) |
Account Number (creditor or debtor identification) |
Name |
Account Type |
Account Accepts |
Clearing System |
Status |
||
Creditor Account |
061103852 |
11101011 |
John Q. Public |
Current |
Credits |
United States Routing Number |
Active |
|||
Debtor Account |
061103852 |
11101012 |
Jane Smith |
Savings |
Debits |
United States Routing Number |
Active |
|||
Creditor Account |
061103852 |
11101013 |
John Smith |
Current |
Credits |
United States Routing Number |
Active |
|||
Debtor Account |
061103852 |
11101014 |
Jane Public |
Savings |
Debits |
United States Routing Number |
Active |
|||
Creditor and Debtor Accounts |
061103852 |
11101015 |
Jane Smith |
Current |
Credits and Debits |
United States Routing Number |
Active |
|||
Creditor and Debtor Accounts |
061103852 |
11101016 |
John Smith |
Savings |
Credits and Debits |
United States Routing Number |
Active |
|||
Creditor Account |
061103852 |
11101017 |
John Q. Public |
Current |
Credits |
United States Routing Number |
Closed |
|||
Creditor Account |
061103852 |
11101018 |
Jane Public |
Current |
Credits |
United States Routing Number |
Active |
|||
*NOTE: A response may return as 200 OK – Disabled if the API call request information is correct, but the account is closed, or may not accept a credit or debit payment.
Using the sample customer-related data below will provide you with examples of failed API calls. These should all return a negative response of 404 Not Found – Disabled.
Negative Responses:
|
API Call |
Routing Transit (member identification) |
Account Number (creditor or debtor identification) |
Name |
Account Type |
Account Accepts |
Clearing System |
Status |
|||
Creditor Account |
061103852 |
11101012 |
Jane Smith |
Savings |
Debits |
United States Routing Number |
Active |
||||
Debtor Account |
061103852 |
11101018 |
Jane Public |
Current |
Credits |
United States Routing Number |
Active |
||||
Creditor Account |
061103852 |
11101019 |
Susy Smith |
Savings |
Credits and Debits |
United States Routing Number |
Active |
||||
Resource URL
Resource URL has been preset for each account validation API:
ACH Credit
ACH Debit
Header Parameter
Select “application/json” in the drop down menu for Content-Type for the Header Parameter.
Try it out!
Input the relevant fields in the value tab from the test data provided.
ACH Credit
ACH Debit
Also, 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”
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).”