REST API Task not found

code:

$row = $api->tasks()->find($id);

id is present in InfusionSoft, I can access it through https://xx111.infusionsoft.com/Task/manageTask.jsp?view=edit&ID=12345&showTaskForm=true&postAction=reloadParentContent

also I can query ContactAction table using XML API to get this task by id, but not with REST API

Error:

Client error: GET https://api.infusionsoft.com/crm/rest/v1/tasks/12345?access_token=qwertyuiop1234567890 resulted in a 404 Not Found response:
{“message”:“Task not found.”}

to prevent comments with obvious observations: I replaced the task id, token and subdomain with fake values :slight_smile:

Is the user account that authorized that token able to see that Task? If it’s not allowed, you’ll only receive a 404 from the endpoint, by design.

Define authorized. The user is admin, I used the same browser session to authorize my app, so this exact user can follow the link and see this task in CRM, but he can’t access it using API

@and_dev,

It’s an API call that requires the access token to be valid (by the way, you generally don’t want to publicly post the token just to be safe). The access token expires after 24 hours and you must use the refresh token to get a new access/refresh token set.