Filtering:
We have recently refactored our filter options (beta). For that reason it has not yet been included in our documentation.
An example of the setup:
filter=<field>:<operator>:<value possibly with quotes>,or,<field>:<operator>:<value possibly with quotes>.
Examples of operators are:
* eq
* gt
* gte
* lt
* lte
* not:eq
API Token
Besides the Oauth 2.0 authentication, it is also possible to create an authentication by generating an API key within your vPlan environment. This way is simpler and less complex.
Sample retrieval of Collections:
GET /v1/collection HTTP/1.1
Headers
X-Api-Key: 1UBCKBFqXhHIuYKrexwoBDRPOfD1TVHxiCWuM8pSE4sjAazW3xbv19ycLhFRoepB
X-Api-Env: e45c6167e427072e74f1c5ca80c5d8ea8f32d1a8
Sample Creation Collection:
POST /v1/collection HTTP/1.1
Headers:
Content-Type: application/json;charset=UTF-8
X-Api-Key: bukpZdA70tXYa1hlI3MOQWjLM32FVdRyOFKQD7datSPvZclbCWzIDIEFElmFDG6Y
X-Api-Env: 6e9b045da9c3cc74b88ec1e4e73c926ca281c5cc
Body:
{
"name": "this is a test2",
"meta":["relation","123","pppp",456,"aaa",{"ccc":"bbb”}]
}
Free fields:
It is possible to create/update Custom Fields via the API.
The PUT and POST are indeed not yet documented. They will be available soon.
However they can be used already:
The PUT can be found at: https://api.vplan.nl/v1/collection/{collection_id}.
The POST can be found at: https://api.vplan.nl/v1/collection/{collection}.
See, for example, the example below:
{
"custom_fields":[
{
"name": "Free field",
"type": "text",
"priority":0,
"value":''test''
}
]
}
Collection + Includes + Filters
With the Collection there are a number of include options:
* activities
* attachments
* cards
* comments
* labels
* source
The latter refers to the source object, which is the Order itself, so not always relevant.
It is possible to use it from the order endpoint, by including a point ". between the objects.
For example:
GET https://api.vplan.nl/v1/order?filter=external_ref:eq:123456&include=collection.activities,collection.labels,orderRows.activity
In this way, you collect the Order, with the associated Collection, any associated Activities and Labels from that Collection.
And then you also retrieve all Order Lines with the associated Activity if any.
Note that we have a number of processes asynchronous, if you create the Order and the Order Rules.
And a fraction of a second later the collection retrieves, then there is a chance that the Collection is not yet fully updated.
Comments
0 comments
Article is closed for comments.