URL Routing

For starters, you will need the URL of the ASAP API. Here is the URL for our sandbox:

http://stagingapi.asapconnected.com/api">http://stagingapi.asapconnected.com/api">http://stagingapi.asapconnected.com/api

The Live API is here:

http://api.asapconnected.com/api">http://api.asapconnected.com/api">http://api.asapconnected.com/api

This URL is the base for all the calls we are going to make. We are going to mark it with a %Base token to explain the additional URLs. The API possesses three main forms of routes:

1. %Base/{controller name in plurar}/{[filter parameter/ filter parameter/filter parameter]}

This URL is for retrieving a list of results depending of the filter parameters. The filter parameters are optional and can be sent in the URL or in the Query string (if you know the name of the parameters).

Example: %Base/invoices/paid/2012-01-01/2012-02-01/1000

This URL asks for the invoices with those statuses are paid, they were made between January 1st of 2013 and February 1st of 2013, and the Account ID is 1000. We also can send the filters in the query string like this: %Base/invoices/?status=paid&datefrom=2013-01-01&dateto=2013-02-01&accountid=1000.

2. %Base/{controller name}({id})/{filter}

This URL asks for one entity or for a list of child entities related to that entity. Depending of the entity, it could have different child entities, like invoice has invoice items and invoice transactions.

Example: %Base/invoice(1000)/summary

This URL asks for the invoice with the id 1000 and it’s asking for the summary.

3. %Base/{controller name}/{id}

This is the most generic kind of URL and is used to retrieve a summary of one entity, and if you change the HTTP method, is used to insert or update one entity. Example: %Base/invoice/1000
Have more questions? Submit a request

Comments

Powered by Zendesk