Home > other >  Facing login issue with loginWithAccesstoken for docusign
Facing login issue with loginWithAccesstoken for docusign

Time:12-04

Update: problem Resolved: Check below comments

Using Docusign as a framework, during login it is giving below error.

Error Domain=user.additional.data.fetch.error Code=-1016 "Unable to fetch additional data for user - Request failed: unacceptable content-type: text/html" UserInfo={NSLocalizedDescription=Unable to fetch additional data for user - Request failed: unacceptable content-type: text/html, NSLocalizedFailureReason=USER_ADDITIONAL_DATA_FETC

Below is data used for login

NSString * userName = @"D*****y";
        NSString * accessToken = @"eyJ0eXAiOiJNVCIsImFsZyI6IlJTMjU2Iiwia2lkIjoiNjgxODVmZjEtNGU1MS00Y2U5LWFmMWMtNjg5ODEyMjAzMzE3In0.AQoAAAABAAUABwAAEozC_7LZSAgAAFKv0EKz2UgCADH-vovuycJOtx8b-0T42BgVAAEAAAAYAAEAAAAFAAAADQAkAAAAMDFmZmFjMmQtMWU2Zi00OTk2LTlmMTgtM2E0MWMzNmVkZmMwIgAkAAAAMDFmZmFjMmQtMWU2Zi00OTk2LTlmMTgtM2E0MWMzNmVkZmMwMACAkGNv-rLZSDcAct05PIuJOEitb0Mnkb4e_A.UdjyVjBFNUL6Lq7H5ulDAOe_NhpygYGQHKUyAJYdEthfo8EXIX6DEE5aLZLdKxnB-CjrTFz9NWjGkIVUFpXuDPukWgWkuWDRNI0s57fe09rws4JAsIovlh0regrd1eh-wGUwAhLLqzivtmz-fR23PVryCeUll-JsS-y_PCfrfZDQJj4JQ3D44olnSDvvYQ-tyDBChwLatPiwWBnD9ef4UHWZzp2dYbnURhkhVM7SgXXnhkz5FF1J-bUmSVPURDAkGIx8TA5VpXPA2gxt5ydo01IDk5pe1OWJCBC9Tue89SSLysum1NoFbzvhpGPRB2IMDmKg7J8QYoSy1-*******";
NSString * userId = @"8bbefe31-****-4ec2-****-1bfb44f8d818";
NSString * accountId = @"1******6";
NSString * email = @"kdines*****@gmail.com";
NSString * demoHostApi = @"https://account-d.docusign.com/";
NSString * integratorKey = @"01ffac2d-****-4996-****-3a41c36edfc0";

Below function is used for login

  [DSMManager loginWithAccessToken:accessToken accountId:accountId userId:userId userName:userName email:email host:[NSURL URLWithString:hostApiUrl] integratorKey:integratorKey completion:^(DSMAccountInfo *accountInfo, NSError *error) {
}];

CodePudding user response:

First, off, it appears you have a hardcoded access token. That may work for a while, but these tokens expire after 8 hours and it's not a long term solution to copy/paste them into your code.

As Paul pointed out the URL to make API calls in DocuSign (for the eSignature API) are : https://demo.docusign.net/restapi in the developer account and https://www.docusign.net/restapi in production (although you may have a different one for your account)

Best practice is to call the getUserInfo which provides the list of one or more accounts for the logged in user. The account information includes the baseURI which can be used to make API calls.

  • Related