简体   繁体   English

DocuSignAPI REST-为什么我的OAuth请求无法通过?

[英]DocuSignAPI REST - Why won't my OAuth request go through?

I'm attempting to use the DocuSign REST API and create an OAuth request to execute Send of Behalf of (SOBO). 我正在尝试使用DocuSign REST API并创建OAuth请求以执行(SOBO)的“代表发送”。 Although I can't complete the first task, it's giving me back a Bad Request. 尽管我无法完成第一个任务,但这给了我一个不好的要求。 What am I doing wrong? 我究竟做错了什么?

Request with Headers: 带标题的请求:

POST https://demo.docusign.net/restapi/v2/oauth2/token

Accept: application/xml
Content-Type: application/xml
Content-Length: {length of body}

Request Body 请求正文

<OAuthTokenRequest>
  <grant_type>password</grant_type>
  <client_id>{IntegratorKey}</client_id>
  <username>test@email.com</username>
  <password>{Password}</password>
  <scope>api</scope>
</OAuthTokenRequest>

Response with Error: 错误回应:

400 Bad Request 

<oauthErr xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <error>invalid_request</error>
  <error_description>An OAuth2 error occurred:</error_description>
</oauthErr>

Although most of the DocuSign REST API accepts XML formatting, OAuth requests must be made in x-www-form-urlencoded . 尽管大多数DocuSign REST API都接受XML格式,但是OAuth请求必须以x-www-form-urlencoded进行

Change your request to the following: 将您的请求更改为以下内容:

Request with Headers: 带标题的请求:

POST https://demo.docusign.net/restapi/v2/oauth2/token

Accept: application/xml
Content-Type: application/x-www-form-urlencoded
Content-Length: {length of body}

Request Body: 请求正文:

grant_type=password&client_id={IntegratorKey}&username=test@email.com&password={Password}&scope=api

Sample Response: 样本响应:

200 OK

<oauthAccess xmlns="http://www.docusign.com/restapi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <access_token>{Access Token}</access_token>
  <scope>api</scope>
  <token_type>bearer</token_type>
</oauthAccess>

More information can be obtained in this documentation . 可以在本文档中获取更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 DocuSignapi-OAuth API调用被视为具有其数量限制的API请求 - DocuSignapi - OAuth API call is counted as API request that has limitation of its number 为什么DocusignAPI的绝对/固定选项卡位置不一致? - Why are absolute/fixed tab positionings for DocusignAPI not consistent? docusignapi usefinfo api 不返回属性 - docusignapi usefinfo api doesn't return attributes DocusignAPI-如何通过api调用获取和更新模板的cusom字段 - DocusignAPI - How to get & update cusom fields of template through api call Docusignapi Invalid_Request_Body XML如何编码特殊字符 - Docusignapi Invalid_Request_Body XML how to encode special characters 将TextBox字段和选择列表添加到通过DocuSignAPI发送的pdf中 - adding TextBox Field and Picklist to pdf that send through DocuSignAPI Curl 命令未转换为 postman 请求 - 开发人员 DocusignAPI - Curl Command does not convert to postman request- developer DocusignAPI DocuSignAPI:带有值的可选“自定义文本”选项卡无法修改 - DocuSignAPI: Optional Custom Text Tab with value can't be modified 新的REST API是否仍支持来自DocuSign OAuth的OAuth2令牌请求(资源所有者凭证或SAML)? - Is OAuth2 Token request from DocuSign OAuth (Resource Owner Credentials or SAML) still be supported in new REST API? DocusignAPI-问题-尝试在发送之前将数据推送到模板,但它不起作用 - DocusignAPI - Issue - Trying to push data to template before sending & it doesn't work
相关标签
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM