Problems using RightSignature API

  • 1
  • Question
  • Updated 4 months ago
I need to use authorizations but with a Post Method. I'm new working with right signature API and I'm not sure how to do it
Photo of Isis Villuendas

Isis Villuendas

  • 4 Posts
  • 1 Reply Like

Posted 4 months ago

  • 1
Photo of Kelly Leeman

Kelly Leeman, Employee, Software Engineer

  • 59 Posts
  • 4 Reply Likes
It depends on which type of authentication you are using, but you include the auth in the header.  There have been several posts about the authentication.  Perhaps reviewing these will help?  If not please provide a more specific question.
Photo of Isis Villuendas

Isis Villuendas

  • 4 Posts
  • 1 Reply Like
I'm trying to use Authentication with Private API Token but I need more information on how to build the header because I'm getting The remote server returned an error: (401) Unauthorized.

this is my code

Dim uri As String = "https://api.rightsignature.com/oauth/token"

            Console.WriteLine(uri)

            Dim parameters As Dictionary(Of String, Object) = New Dictionary(Of String, Object)
            parameters.Add("client_id", clientId)
            parameters.Add("client_secret", clientSecret)
            parameters.Add("API_Token", access_token)

 Dim bodyParameters As ArrayList = New ArrayList()
            For Each kv As KeyValuePair(Of String, Object) In parameters
                bodyParameters.Add(String.Format("{0}={1}", HttpUtility.UrlEncode(kv.Key), HttpUtility.UrlEncode(kv.Value.ToString())))
            Next

            Dim requestBody As String = String.Join("&", bodyParameters.ToArray())

            Dim request As HttpWebRequest = WebRequest.Create(uri)
            request.Method = "POST"
            request.ContentType = "application/x-www-form-urlencoded"
            Using writer As New StreamWriter(request.GetRequestStream())
                writer.Write(requestBody)
            End Using

Dim response As HttpWebResponse =   request.GetResponse()
Photo of Kelly Leeman

Kelly Leeman, Employee, Software Engineer

  • 59 Posts
  • 4 Reply Likes
If you are trying to use the private token, then you do not need the oauth stuff to include the client id and secret.  You would just needs the basic auth with your base64 encoded private toke in the header of the call you are making.  Here is a link to explain Basic Http Auth https://en.wikipedia.org/wiki/Basic_access_authentication
Photo of Isis Villuendas

Isis Villuendas

  • 4 Posts
  • 1 Reply Like
I'm using the basic basic auth how you said before and it works fine when I use clone and send document from a template.

What I need to do now it's upload a document, use the tags from a template and send the uploaded document to sign

the document on my computer should be in a specific location?
Photo of Kelly Leeman

Kelly Leeman, Employee, Software Engineer

  • 59 Posts
  • 4 Reply Likes
You will specify the local location when you upload to the the upload url.  https://api.rightsignature.com/documentation/resources/v1/sending_requests/create.en.html
Photo of Isis Villuendas

Isis Villuendas

  • 4 Posts
  • 1 Reply Like
this is my json and I'm still getting error 422

{
"file":{
"source":"remote_file",
"name":"test RS.docx"
},
"document":{
"access_token":"cHZfZDE4ZjBhNGEwOGQ3NDJkN2E2M2Q5OGJhZjIwZTQ4MWM=",
"name":"test RS.docx",
"message":"123",
"expires_in":"30",
"signer_sequencing":"false",
"roles":[
{
"name":"signer1",
"signer_name":"signer1",
"signer_email":"isis@pdpflorida.com"
}
]
},
"sending_request":
{
"upload_url":"PDPHQSRV-FS\\Users\\isis\\Desktop\\test RS.docx"
}
}
Photo of Kelly Leeman

Kelly Leeman, Employee, Software Engineer

  • 59 Posts
  • 4 Reply Likes
we return an upload url to you and then you post the file to that url