簡體   English   中英

無法使用 DocuSign 管理員 API [docusignapi] 更新用戶配置文件

[英]Not able to update user profile using DocuSign admin API [docusignapi]

我想更新用戶的用戶配置文件(Federated_status),我正在使用 DocuSign 管理員 APi 並從組織管理員帳戶生成臨時令牌 - 但是當我調用 Docusing 管理員 api 時,它不會更新它並引發錯誤“未經授權”。

'''try
            {
                HttpContent PostContent = new StringContent(JsonConvert.SerializeObject(ObjUser), Encoding.UTF8, "application/json");
                string reponsebody = string.Empty;
                string Url = "https://api-d.docusign.net/managment/v2/organisation/" + OrgID + "users/profiles";
                using (var client = new HttpClient())
                {

                    client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application / json"));
                    client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token));
                    HttpResponseMessage rep = client.PostAsync(new System.Uri(Url), PostContent).Result;
                    reponsebody = rep.Content.ReadAsStringAsync().Result;
                }
                var userProfileResponse = JsonConvert.DeserializeObject<UserProfile>(reponsebody);
                return userProfileResponse;
            }



'''

I am not sure how to call this admin api to update user profile - "federated status" .
Please help.!

我懷疑您在獲取訪問令牌時沒有包括正確的范圍。 對於向 DocuSign 管理員 API 提出的請求,您必須包括特殊范圍。 我為每種類型的身份驗證提供了一些代碼示例。

如果您使用的是 JWT,您的令牌正文將如下所示...

{
  "iss": "5c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f",
  "sub": "464f7988-xxxx-xxxx-xxxx-781ee556ab7a",
  "iat": 1523900289,
  "exp": 1523903289,
  "aud": "account-d.docusign.com",
  "scope": "signature organization_read group_read user_read user_write"
}

對於 Auth Code Grant,您的請求必須包含 DocuSign Admin 范圍,包括在此示例中:

https://account-d.docusign.com/oauth/auth?response_type=code&scope=signature%20organization_read%20group_read%20user_read%20user_write&client_id=7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f&state=a39fh23hnf23&redirect_uri=http://example.com/callback/http://example.com/callback/

對於隱式授權,您的請求將類似,但響應類型不同

https://account-d.docusign.com/oauth/auth?response_type=token&scope=signature%20organization_read%20group_read%20user_read%20user_write&client_id=7c2b8d7e-xxxx-xxxx-xxxx-cda8a50dd73f&state=a39fh23hnf23&redirect_uri=http://example.com/callback/

有關各種類型的 scope 的更多信息,請參閱我們的DocuSign Admin API Auth指南。 讓我知道這是否有幫助。

你可以這樣做:

GET /v2/organizations/{organizationId}/users/profile

但更新是:

POST /v2/organizations/{organizationId}/users/profiles

不同的端點,我知道這很混亂。

確保你做的是 POST,而不是 GET

https://developers.docusign.com/orgadmin-api/reference/Users/Users/updateUser

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM