+ Add Question

[API] project_update explanation

Hi there,


I am need a explanation about project_update function from Todoist Sync API v2! How it works?

Where do I put the id of the project to update?

All responses

David Trey staff
Replied on Oct 22, 2013 - 06:06

Hello Richard,

Please refer to this documentation: https://todoist.com/API/help/sync#json_object_commands and let me know if it helps.


Best regards,
David

Richard Lopes
Replied on Oct 23, 2013 - 18:03

I already did it. But is not clear where do I put the id of the project to update.

Richard Lopes
Replied on Oct 23, 2013 - 18:09

"args": {
"name": "New name",
"indent": 1,
"color": 7,
"id": "$1326467493134"
}

I think that this "id" is about the timestamp with a $. Right?

Brendon Wadey staff
Replied on Oct 23, 2013 - 20:22

Richard,

I have asked your question to the developer.

Thanks,
Brendon.

Richard Lopes
Replied on Nov 07, 2013 - 07:41

News?

David Trey staff
Replied on Nov 07, 2013 - 08:25

Hello Richard,

Unfortunately, we haven't heard back about this from the developers yet, but as soon as we do, we'll get back to you. Sorry for the delay.


Best regards,
David

Amir Salihefendic staff
Replied on Nov 14, 2013 - 06:14

Hi Richard

You need to do a sync command like this:
https://gist.github.com/amix/f348307f16944aba9e83

Let us know if this works!

Sorry for the wait time.

Regards,
Amir

Richard Lopes
Replied on Nov 15, 2013 - 06:08

Thanks for reply.

I am trying to understand the code:

Inside 'args', there is a 'id' field, right?

"id": "$1326467493134"

What, exactly, should contain the field? project's id without '$' ?

Richard Lopes
Replied on Nov 19, 2013 - 14:27

News?

Richard Lopes
Replied on Mar 22, 2014 - 10:11

Long time has passed and I can't update a project using API.

So let me try again:

{
"type": "project_update", #type of requisition, update
"timestamp": 1326467500573, #timestamp of when the requisition was made (to avoid duplicated requests
"args": {
"id": "$1326467493134", #some temporary id, that will be replaced at the response of this request through the filed "TempIdMapping"
"name": "Test new", #updated name
"item_order": 5, #updated order
"color": 2 # updated color
}



The main question is: Where does this request know which is the project that the server should update? Does the request should provide a parameter, called "id", to indicate this?


Amir Salihefendic staff
Replied on Mar 24, 2014 - 07:53

Hi Richard

"id": "$1326467493134" is a temporary id, you can easily use a normal id as well (such as "id": 2323).

Why do you need temporary ids? You need this in order to build an offline client. While offline when you create a project you won't have its real ID - - hence you will use a temporary one. The API has great support for managing temporary ids.

Hope this answered your question.

Best regards,
Amir

Richard Lopes
Replied on Jul 11, 2014 - 09:19

After some time, let me try again:

Over this request, what is the project ID (ON THE TODOIST SERVER) am I updating?

{
"type": "project_update", #type of requisition, update
"timestamp": 1326467500573, #timestamp of when the requisition was made (to avoid duplicated requests
"args": {
"id": "$1326467493134", #some temporary id, that will be replaced at the response of this request through the filed "TempIdMapping"
"name": "Test new", #updated name
"item_order": 5, #updated order
"color": 2 # updated color
}