API uses a POST call as a GET because the JSON query is too long; how to configure with call template

Hi all,

I am currently trying to configure an API in the shape of a call template as a first test. However, even though the request is a GET, the API developers chose to configure it as a POST because the URL gets too long if the query is written as a GET.

This means the API uses a body to send a query and to return the results.

In this context, what I would like to do is POST the BvDID (the ORBIS equivalent of KvK) to the ‘where’ query to GET the ‘select’ data that gets produced after I send the information. I have read in another post that you can POST data using a data definition, only I do not understand how the {“WHERE”: [“”], “SELECT” [“”] } part of the JSON can be implemented. To me, it seems like I can only POST the contents of the ‘where’ using the data definition.

So my question is: how can I send along the whole query in the JSON using a call template?

I don’t quite understand what you mean with send a query in a json

You can use a data definition (incl parameters, which is optional) to build the body of the request. What context are we talking about here? Do you maybe have an example?

Hi Joeri,

Thank you for your reply.

The query that the API developers gave is as follows (redacted):

{

“WHERE”: [

{

“BvDID”: [

“”

]

}

],

“SELECT”: [

{

“NAME”: {

“AS”: “NAME”

}

},

{

“GRID_MATCH_INDICATOR”: {

“AS”: “GRID_MATCH_INDICATOR”

}

},

{

“GRID_MATCH_SANCTIONS_INDICATOR”: {

“AS”: “GRID_MATCH_SANCTIONS_INDICATOR”

}

},

{

“GRID_MATCH_WATCHLIST_INDICATOR”: {

“AS”: “GRID_MATCH_WATCHLIST_INDICATOR”

}

},

{

“CPYCONTACTS_HEADER_FirstNameOriginalLanguagePreferred”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_FirstNameOriginalLanguagePreferred”

}

},

{

“CPYCONTACTS_HEADER_LastNameOriginalLanguagePreferred”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_LastNameOriginalLanguagePreferred”

}

},

{

“CPYCONTACTS_HEADER_Gender”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_Gender”

}

},

{

“CPYCONTACTS_HEADER_Birthdate”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_Birthdate”

}

},

{

“CPYCONTACTS_MEMBERSHIP_Function”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_MEMBERSHIP_Function”

}

},

{

“CPYCONTACTS_HEADER_IdDirector”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_IdDirector”

}

},

{

“CPYCONTACTS_HEADER_BvdId”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_BvdId”

}

},

{

“CPYCONTACTS_HEADER_GRID_MATCH_INDICATOR”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_GRID_MATCH_INDICATOR”

}

},

{

“CPYCONTACTS_HEADER_GRID_MATCH_SANCTIONS_INDICATOR”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_GRID_MATCH_SANCTIONS_INDICATOR”

}

},

{

“CPYCONTACTS_HEADER_GRID_MATCH_WATCHLIST_INDICATOR”: {

“FILTERS”: [redacted]

“AS”: “CPYCONTACTS_HEADER_GRID_MATCH_WATCHLIST_INDICATOR”

}

},

{

“BO_NAME”: {

“FILTERS”: [redacted]

“AS”: “BO_NAME”

}

},

{

“BO_GRID_MATCH_INDICATOR_FORMATTED”: {

“FILTERS”: [redacted]

“AS”: “BO_GRID_MATCH_INDICATOR_FORMATTED”

}

},

{

“BO_GRID_MATCH_SANCTIONS_INDICATOR_FORMATTED”: {

“FILTERS”: [redacted]

“AS”: “BO_GRID_MATCH_SANCTIONS_INDICATOR_FORMATTED”

}

},

{

“BO_GRID_MATCH_WATCHLIST_INDICATOR_FORMATTED”: {

“FILTERS”: [redacted]

“AS”: “BO_GRID_MATCH_WATCHLIST_INDICATOR_FORMATTED”

}

}

]

}

As you can see, it is already very long even with the actual filters redacted. What I want to show with this is that they use ‘where’, ‘select’ and ‘filter’ queries, and I do not know how to put that into a data definition.