ToDoIst integration

399 views Asked by At

im trying to integrate todoist with my platform, so using the current API of todoist i was able to make a oauth2 request.

<?php
$url = "https://todoist.com/oauth/authorize";
$post_data = array(
    'client_id' => '########################',
    'scope' => 'data:read,data:delete',
    'state' => '###################'
);

print_r($post_data);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

$output = curl_exec($ch);

var_dump($output);

curl_close($ch);

?>

But when i execute this script i got a error of invalid scope.

Looking on documentation i got the following rule:

scope => A comma separated list of permissions which you would like the users to grant to your application. See below a table with more details about this.

My question may be dummy but i think im passing in a wrong format.

Can someone explain me the right way to make a proper request?

0

There are 0 answers