Retrieving URLs
Now that you have a valid access token, you can start using the SlimPay API.
As a REST compliant API, secure communication with SlimPay is done over the Internet via HTTPS. Your first call to the API will always be a GET request to the entry point.
Here is an example of an entry point request:
GET https://api.preprod.slimpay.com/ HTTP/1.1
Accept: application/hal+json; profile="https://api.slimpay.net/alps/v1"
Authorization: Bearer yourToken
Included in the entry point response is the _links property. This is a map of key/value pairs, where the key is the relation name (rel) and the value is the corresponding object (or array of objects).
Here is an excerpt from the entry point response:
{
"_links" : {
"self" : {
"href" : "https://api.preprod.slimpay.com/"
},
"https://api.slimpay.net/alps#create-orders" : {
"href" : "https://api.preprod.slimpay.com/orders"
},
"https://api.slimpay.net/alps#get-orders" : {
"href" : "https://api.preprod.slimpay.com/orders{?creditorReference,reference}",
"templated" : true
},
[...]
}
}
Each link has at least one property, href. This is a URL provided by the SlimPay server where you can send your next HTTP request (see HATEOAS).
Looking at the example response above, if you want to follow the create-orders relation, this means looking into _links
» https://api.slimpay.net/alps#create-orders
» href
and using this URL for your next request. In this case it would be https://api.preprod.slimpay.com/orders
.
If a link is templated (like the get-orders relation in the example above), this means that you must use URL templates to pass parameters. Some libraries already exist to make this easier, designed according to RFC 6570 standards.
Now that you’re ready to start integrating SlimPay, find out where you can go next!