Is API Documentation up-to-date?

rest-api
#1

I tried to use the curl that is included in the Data API:

curl -H ‘Content-Type: application/json’
-H ‘Accept: application/json’
-H ‘Authorization: Bearer YOUR_API_ACCESS_TOKEN’
-X POST
-d ‘{“email”:“example@losant.com”,“deviceIds”:[“575ecf887ae143cd83dc4aa2”,“575ef5c97ae143cd83dc4aac”],“attributes”:[“voltage”],“end”:0,“options”:{“includeDate”:false,“includeID”:true}}’
https://api.losant.com/applications/APPLICATION_ID/data/export

The error message I receive is:
{“type”:“Validation”,“message”:“query has additional properties”}

I have gotten other API calls to work fine. It appears to me that I am missing a required property (when I enter the same thing with only the Email property - by the way, “email” gives me an error message but “Email” is OK - I get the same error. I know when I enter only the Email property that I am missing properties. So, I deduced that the error message tells me I am missing properties. But I am including all the properties in the API documentation, including the same CURL command with only minor modifications for my device.

#3

Hi @Mark_Rauch,

It looks as though there is a bug in that endpoint, and our engineering team is currently working to fix it. I will update you when the fix is released! :smile:

Cheers,
Julia

#4

Do you have an update yet?

Mark Rauch

Sr. Manager, Applications Development Office: 201.539.1621

cid:a1f833ce-7c0d-4e61-be9d-713b286a5939

#5

Hi @Mark_Rauch,

A fix has been released for this endpoint. Thank you for your patience!

Cheers,
Julia

#6

Julia,

Thanks for getting back to me. I still cannot get it to work. Do you mean that the CURL command is OK as written and the code has been fixed or that the documentation was not correct? Have you been able to get it to work?

Mark

#7

Hi Mark,

I was able to get export working with both Postman and cURL. However, Postman automatically set my Content-Type to “application/x-www-form-urlencoded” without my knowledge, resulting in the “query has additional parameters” error. Changing it back to application/json gave me a {"success":true} response. Here is my passing configuration for both:

cURL

Postman

If you are still unable to export the data, I would recommend testing with Postman and seeing what you get back!

Thanks,
Julia