Skip to main content
February 7, 2019
Answered

Salesforce sending agreement from apex : Invalid user ID or email provided in x-api-user header.

  • February 7, 2019
  • 2 replies
  • 7897 views

Hi All

I am integrating adobe sign with B2B commerce in salesforce. I need to send an agreement on custom logic execution. The running user will be a Community user in the end but for now I test with Admin users.

I do not know how can I use the provided load and send methods to send the agreement as someone else ?

    Id agreement = echosign_dev1.AgreementTemplateService.load(template.Id,order.ccrz__Contact__c,variablesMap );

echosign_dev1.EchoSignApiService.SendDocumentResult documentResult = echosign_dev1.EchoSignApiService.sendDocument(agreement);

I have tried to change the agreement template so that is has send on behalf of but this seems to only work if you use standard functionality and not loading from apex ? My running test user has :

Adobe Sign Allow Sending As Other UsersChecked

My created agreement record for which I have the error has :

echosign_dev1__Sender_User__c0051t000001JziGAAS

And that user whose Id is populated is valid admin user which has adobe sign account and I was able to use my functionality when logged in as that user.

It's worth mentioning that my Agreement template has no document loaded but It's setup to use Runtime Variable.

Regards,

Mateusz

This topic has been closed for replies.
Correct answer

Thanks meenakshin83966505​ . I have solved the issue on my own .

So the first problem is that I have added "Adobe Sign Allow Sending As Other Users" on the running user and not on the user who's Id is specified in Agreement Template.

Another issue is that for community user to see another user email you have to set a flag on user record via api ( workbench ) :

UserPreferencesShowEmailToExternalUsers

2 replies

Correct answer
February 11, 2019

Thanks meenakshin83966505​ . I have solved the issue on my own .

So the first problem is that I have added "Adobe Sign Allow Sending As Other Users" on the running user and not on the user who's Id is specified in Agreement Template.

Another issue is that for community user to see another user email you have to set a flag on user record via api ( workbench ) :

UserPreferencesShowEmailToExternalUsers

Meenakshi Negi
Community Manager
Community Manager
February 7, 2019

Hi Mateusz,

I have checked the email address that you used to sign in to the Adobe forums.

Currently, you are using the Adobe Sgn trial account.

As you need to test the Adobe Sign integration with Salesforce, I would suggest you register for the free Developer edition of the Adobe Sign here Create Developer Account, APIs for custom applications | Adobe Sign

Please make sure that you use an email address which is not registered for any other Adobe Sign account.

The settings for integration are not enabled by default in the free Developer account.

I would recommend you contact Pre-Sales team to get the settings enabled.

They will also be able to provide pre-sales technical assistance to you.

Please refer to this link Adobe Sign plans for individuals and businesses | Adobe Document Cloud to get in contact with them.

Hope the information helps.

Let us know if you have any questions.

Regards,

Meenakshi