Customize Signer Email content using RightSignature API

  • 2
  • Question
  • Updated 1 year ago
We are using RightSignature API to send a document to the signers in the sequence order. We would like to add custom messages in to the mail body content. As RightSignature suggested in the API document, we have enabled "personalized_messages" as true and addedd message to each signer in the below JSON but the email does not getting any given messages.

https://api.rightsignature.com/public/v1/sending_requests

{
    "file": {
        "name": "CER-INTE-170701-02 - Test.docx",
        "source": "upload"
    },
    "document": {
        "signer_sequencing": true,
        "expires_in": "12",
        "name": "CER-INTE-170701-02-WORK ORDER",
        "personalized_messages": true,
        "roles": [{
            "name": "a",
            "signer_name": "Poomani Sankaran",
            "signer_email": "spoomani@test.com",                     
            "sequence": 0,
            "message": "Test Singer1"
        }, {
            "name": "b",
            "signer_name": "CAF PM",
            "signer_email": "nvignesh@test.in",          
            "sequence": 1,       
            "message": "Test Singer2"           
        }]
    }
}

We are looking for the feasibility. Please guide us in the right way.

Thanks & Regards
Poomani Sankaran
Photo of Poomani Sankaran

Poomani Sankaran

  • 2 Posts
  • 0 Reply Likes

Posted 1 year ago

  • 2
Photo of Grace Powers

Grace Powers, Employee

  • 14 Posts
  • 5 Reply Likes
Hello Poomani,

We have made some updates to our API and the custom Message should now be going out in the email notifications. 

Thanks,

Grace
Photo of Farqalit Nasir

Farqalit Nasir

  • 22 Posts
  • 0 Reply Likes
Hi,
I need help in document uploading 
I'm using new RightSignature API “public/v1/sending_requests”
and it throws invalid_scope error.
Please help,
Photo of Kelly Leeman

Kelly Leeman, Employee, Software Engineer

  • 90 Posts
  • 5 Reply Likes
Hi Farqalit, 

Without having more information, I would guess that the api key you are using is read only and not read/write.  Can you log into Rightsignature and navigate to the api section and check the scope of the key that you are using?  If it is read only, you will need to create a new key that has a read/write scope.  Before you can create the new key, you will need to edit the redirect uri on your current key as these need to be unique.
Photo of Farqalit Nasir

Farqalit Nasir

  • 22 Posts
  • 0 Reply Likes
Hi Kelly,
Thanks for your reply,
I have followed your suggestions and found my Api access defined as read/write before.

Hear is my script 
$arr = array(

'file' =>
array(
'name' => 'pdf.pdf',
'source' => 'upload',
),
'document' =>array(
'signer_sequencing' => 'true',
'expires_in' => '12',
'name' => 'Signme',
'personalized_messages' => true,
'roles' =>array(
'name' => 'a',
'signer_email' => 'farqalit.techloyc@gmail.com',
'signer_name' => 'farqalit',
'sequence' => 0,
'message' => "Message"
),
),
 

        );

    $post_json = json_encode($arr);
 
$endpoint = "https://api.rightsignature.com/public/v1/sending_requests?access_token=My_Access_Token";

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_json);       
    curl_setopt($ch, CURLOPT_URL, $endpoint);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' ));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);

And I  Got  

Error:400
{
    "error": "invalid_scope",
    "error_description": null
}

Please Help !
(Edited)
Photo of Deepikaa Subramaniam

Deepikaa Subramaniam

  • 3 Posts
  • 3 Reply Likes
Hi Farqalit Nasir

While trying to repro the issue that you are seeing while executing the script, it looks like the ACCESS_TOKEN should need read and write scope as well for sending a document. 

Could you provide us information on what application ID you are using and how you are generating this access token. 

Sorry about the inconvenience.

Thanks, 
Photo of Farqalit Nasir

Farqalit Nasir

  • 22 Posts
  • 0 Reply Likes
Hi Deepikaa,

Here are the steps which I used to get access_token.

1)Api  /oauth/authorize .
   I got authorization code by passing client Id and redirect Uri. 

2)Api oauth/token
  passes auth code with client_id,client_secret and redirect Uri to get my     access_token.

I got access token with refresh token successfully.I also retrieved user information by using Api "public/v1/me/" with my generated access token.
But this access token does't allow me to upload my files.
Although I set my Api scope as  "Read/Write" but when I ask for grant access Its access_permission shows me Read only.

Why it shows different values for access scope ?
What is actual Api scope defined for my Api ?
 

Your help would be much appreciated!


Thanks,
(Edited)
Photo of Deepikaa Subramaniam

Deepikaa Subramaniam

  • 3 Posts
  • 3 Reply Likes
when you make the authorize call to get the authorization code, add &scope=read write to get the Access token with the right permissions. https://api.rightsignature.com/documentation/resources/v1/oauth_authorizations/default_url_options.h...
scope is listed as an optional param in this documentation.
Photo of Farqalit Nasir

Farqalit Nasir

  • 22 Posts
  • 0 Reply Likes
Thank you deepikaa, now I got the point. 
It works for me.