Oauth 接收带有/令牌API端点的错误代码1004

Oauth 接收带有/令牌API端点的错误代码1004,oauth,smartsheet-api,Oauth,Smartsheet Api,oauth令牌授权是否需要付费帐户?我尝试使用免费帐户和试用帐户执行以下操作 发送/令牌POST将导致: { "errorCode": 1004, "message": "You are not authorized to perform this action.", "refId": "cd9hgzwmdduh" } 我使用以下参数: grant_type: authorization_code code: <acquired from step 1. in oaut

oauth令牌授权是否需要付费帐户?我尝试使用免费帐户和试用帐户执行以下操作

发送/令牌POST将导致:

{
   "errorCode": 1004,
   "message": "You are not authorized to perform this action.",
   "refId": "cd9hgzwmdduh"
}
我使用以下参数:

grant_type: authorization_code
code: <acquired from step 1. in oauth flow>
hash: <see below>

这些是我在成功实现端点之前纠正的错误:

  • 在创建SHA256散列时,我忘了将
    |
    连接在
    app\u secret
    code
    之间。要发送的正确sha256哈希应为:

    echo-n“$app_secret |$code”| openssl dgst-sha256

  • 标题应为:

    内容类型:应用程序/x-www-form-urlencoded

  • 我应该以x-www-form-urlencoded参数发送,而不是作为url查询参数发送

  • 以下是HTML协议的全文:

    POST /2.0/token HTTP/1.1
    Host: api.smartsheet.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code&client_id=<client_id>&code=<code from step 1 of oauth flow>&hash=<see above>
    
    POST/2.0/token HTTP/1.1
    主持人:api.smartsheet.com
    内容类型:application/x-www-form-urlencoded
    grant\u type=authorization\u code&client\u id=&code=&hash=
    
    ```

    POST /2.0/token HTTP/1.1
    Host: api.smartsheet.com
    Content-Type: application/x-www-form-urlencoded
    
    grant_type=authorization_code&client_id=<client_id>&code=<code from step 1 of oauth flow>&hash=<see above>