Batch requests
Instead of making many asynchronous GET requests to the RamBase API, it is possible to combine these requests into one single synchronous GET request. Note that the API server run all requests in parallell, which might result in a different order than provided.
The syntax of the request URI is:
Example
In this example both sales orders and customers are requested in one single batch request:
The result is divided into one result section for each request:
Query parameters
In some cases the different requests might have query parameters that should only apply to the specific requests. In these cases the requests should be percent-encoded. Example:
GET /sales/orders?$db=ABC-SE&$lang=swe
GET /sales/orders?$db=BCD-NO&$lang=nob
Combined batch request:
https://api.rambase.net/batch
?resource1=%2Fsales%2Forders%3F%24db%3DABC-SE%26%24lang%3Dswe
&resource2=%2Fsales%2Forders%3F%24db%3DBCD-NO%26%24lang%3Dnob
If not encoded, the query parameters $lang, $access_token,$context and $db will be applied to all requests. The output format of the batch request will always be the same for all of the requests.