Using an access token OAuth 2.0


Each request to the API via OAuth2 protocol must be made over HTTPS with an access token, which must be passed in the authorization header or in the access_token parameter. For all requests, you need to use the basic URL:

https://youraccount.worksection.com/api/oauth2
For example, using the get_tasks API method to get the tasks of a particular project:

curl -X GET -H "Authorization: Bearer <token_value>"
https://youraccount.worksection.com/api/oauth2?action=get_tasks&id_project=193
You will get a response similar to:

{
    "status": "ok",
    "data": [
        {
            "name": "T0",
            "page": "/project/193/13036/",
            "status": null,
            "priority": "1",
            "user_from": "Marcus Wright",
            "user_to": "Marcus Wright",
            "from_me": 0,
            "to_me": 0,
            "date_added": "2023-03-10 16:41",
            "date_start": "2023-03-15",
            "date_end": "2023-03-23",
            "child": [
                {
                    "name": "T0.1",
                    "page": "/project/193/13036/13037/",
                    "status": null,
                    "priority": "1",
                    "user_from": "Marcus Wright",
                    "user_to": "Marcus Wright",
                    "from_me": 0,
                    "to_me": 0,
                    "date_added": "2023-03-10 16:41"
                }
            ]
        }
]
}
Each access token is valid for 24 hours. Then you need to refresh it with refresh_token or get a new one.