⛔️ DEPRECATED
You will need to ad a static-route to your pimcore that looks like this one:
Pattern | Reverse | Controller | Action | Variables |
---|---|---|---|---|
/([a-z]+)\/([0-9]+)(\/[a-z]+)?(\/[a-z]{2})?/ | /api/%objectType/%articleNum{/%returnType}{/%language} | api | default | objectType,articleNum,returnType,language |
The API is based on REST. So you can receive data via a simple URL-call. The most basic way to call it is:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/?apiKey=YOUR_API_KEY
This will return an UTF-8 encoded JSON-object.
The API can handle several params to customize the results.
The type of the return. You can choose between JSON and XML. Default-value is JSON. You can either set this param via the URL-path:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/RETURN_TYPE/?apiKey=YOUR_API_KEY
…or add it as a GET-param:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/?returnType=RETURN_TYPE&apiKey=YOUR_API_KEY
…or send it via POST.
If the chosen language exists, the data will be returned in this language. Else you will receive them in the fallback language ('de'). To set this param you can either set it via the URL-path:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/LANGUAGE/?apiKey=YOUR_API_KEY
…or add it as a GET-param:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/?returnType=LANGUAGE&apiKey=YOUR_API_KEY
…or send it via POST.
With this param you can choose which attributes you want to be returned. To set this param you can either add it as a GET-param:
https://YOUR_URL/OBJECT_TYPE/OBJECT_ID/?att[0]=ATTRIBUTE_1&att[1]=ATTRIBUTE_1&apiKey=YOUR_API_KEY
…or send it via POST.