service.not_authorized while trying to use Oauth - obtain token API in developer portal

I tried using https://connect.squareupsandbox.com/oauth2/token and https://connect.squareup.com/oauth2/token . Both are giving me the same error .

 

curl https://connect.squareupsandbox.com/oauth2/token \

  -X POST \

  -H 'Square-Version: 2023-01-19' \

  -H 'Content-Type: application/json' \

  -d '{

    "code": "sandbox-sq0cgb-eXEaEE3gMDr5vI-xHF0jaQ",

    "client_id": "sandbox-sq0idb-qxqHqp8Ewueh9VfCeqKNxA",

    "client_secret": "<client_secret>",

    "grant_type": "authorization_code"

  }'

 

 

{

  "message": "Not Authorized",

  "type": "service.not_authorized"

}

333 Views
Message 1 of 1
Report
0 REPLIES 0