+ Add Question

API POSTing parameters to https://api.todoist.com/TodoistSync/v5.3/syncAndGetUpdated

Hi,
Does the public Sync API support sending parameters (api_token, seq_no, items_to_sync) in a request body?

I've tried it and I keep getting 403s. Your web app uses this method.

Sending the items_to_sync as part of the URL is extremely error-prone since very long URLs are problematic.
Some of my users (and in extension your) are unable to sync because of this.

A fast response would be appreciated.

Jan

All responses

Brendon Wadey staff
Replied on Jun 28, 2014 - 17:35

Hi Jan,

I will pass this question along to the developers and hope to get a reply soon. Though I have to admit, since we as tech support do not 100% know all of the API questions, it can sometimes take awhile to get a reply from the developer, but hopefully that is not the case.

Regards,
Brendon.

Jan Kratochvíl premium
Replied on Jun 29, 2014 - 12:36

Thanks.
Creating a new special "platform" to which one could post tickets about the API might warrant a consideration.

Jan Kratochvíl premium
Replied on Jul 01, 2014 - 13:45

What is the status?
I'd like to reiterate that it causes some of my users to sync with Todoist.

David Trey staff
Replied on Jul 01, 2014 - 15:30

Hello Jan,

We have passed it to our developers and as soon as they reply, we'll let you know.


Best regards,
David

Amir Salihefendic staff
Replied on Jul 03, 2014 - 14:41

Hi Jan

All our apps use POST to communicate with the Sync API.

Given the error you get please ensure that your API token is correct.

Best regards,
Amir

Jan Kratochvíl premium
Replied on Jul 03, 2014 - 15:09

I too use HTTP POST to communicate with the Sync API, I probably wasn't clear.

When I send the parameters as part of the URL (but still using HTTP POST for the request), it works.

I get 403 when I use HTTP POST *and* send the parameters as the request body, not as part of the request URL.

Examples of (raw) HTTP requests taken from Fiddler:
I. This returns 200:
-----
GET https://api.todoist.com/TodoistSync/v5.3/get?api_token=apiTokenRedacted HTTP/1.1
User-Agent: Fiddler
Host: api.todoist.com
-----

II. This doesn't work (but should in my opinion) and returns 403
-----
POST https://api.todoist.com/TodoistSync/v5.3/get HTTP/1.1
User-Agent: Fiddler
Host: api.todoist.com
Content-Length: 50

api_token=apiTokenRedacted
-----

Amir Salihefendic staff
Replied on Jul 03, 2014 - 20:30

Hi again Jan

This isn't something I can reproduce. Please try to use something like https://github.com/jakubroztocil/httpie to properly test it out.

It seems for me that it could be related to the debug client you use.

Regards,
Amir

Jan Kratochvíl premium
Replied on Jul 03, 2014 - 21:32

Looks like I've made a rookie mistake. :-)
I forgot the "Content-Type: application/x-www-form-urlencoded" header.

Thanks for helping out.
Jan