Overview

Goals are a way to organize tasks. Most people use goals to indicate how tasks contribute to longer term goals or aspirations. For example, a goal may be "get a promotion" and may contain tasks that the user thinks will get them there.

Syncing

Syncing goals is fairly straight forward. The first thing to do is add any new goals you have created and delete any goals that you have deleted. Then, look at the "lastedit_goal" timestamp returned from Account Info to determine if any changes have happened on the server since the last time you synced. If yes, then you need to fetch the goals from the server and integrate this into your local copy. This is where you would do conflict resolution if a goal was edited in both places. After this, if you have any goals that you edited, you can send these edits up to the server.

Retrieving Goals

The "goals/get.php" API call will return a list of your goals. You can access this via GET or POST.

Adding Goals

Add a goal using the "goals/add.php" API call. You can access this via POST. Goal names must be unique within an account. If you try to add a goal that already exists, you'll get an error. Each user can have up to 500 goals. If you try to add more than this, you will get an error.

Editing Goals

Edit a goal using the "goals/edit.php" API call. You can access this via POST. Goal names must be unique within an account. If you try to edit the goal name to one that already exists, you will get an error. If you try to edit the goal, but pass in the same values that already exist on the server, you will get an error. You should avoid making unnecessary edits.

Error Codes

Any of the API calls can return error messages. Here is a list of the error messages that you may receive from the goals API endpoints. If there was an error when editing or deleting a goal, the id number that you attempted to edit will be included in the error's "ref" field for your reference.

401 : Your goal must have a name.

402 : A goal with that name already exists.

403 : Max goal reached (500).

404 : Empty id.

405 : Invalid goal.

406 : Nothing was edited.

Examples:

{"errorCode":402,"errorDesc":"A goal with that name already exists","ref":1234}

<error id="402" ref="1234">A goal with that name already exists</error>