- $ curl
- -X POST
- -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
- -F "recipients[0][name]=John"
- -F "recipients[0][email][email protected]"
- -F "files[0]=@/path/to/the/pdf/document.pdf"
- https://api.sandbox.signaturit.com/v3/signatures.json
i made this code in c#
- using System;
- using System.IO;
- using System.Net;
- using System.Text;
- using System.Web;
- public class Program
- {
- public static void Main()
- {
- string response = SendSignatureRequest(
- "ZDM4NzU1YTVmNmFhNGMwMGQ3MTdiOTBhNmNiZDQzOTlkYjg4OTk0MTg5MGM3OGFlZjk1OWM1ZDg1NTQxYzBjYQ",
- "Mario",
- "[email protected]",
- //"http://www.analysis.im/uploads/seminar/pdf-sample.pdf"
- "@c://Mariete.pdf"
- );
- Console.WriteLine(response);
- }
- public static string SendSignatureRequest(string apiKey, string name, string email, string file)
- {
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://api.sandbox.signaturit.com/v3/signatures.json");
- request.Method = "POST";
- string authorization = apiKey;
- request.Headers.Add("Authorization", "Bearer " + authorization);
- var postData = "recipients[0][name]=" + name;
- postData += "&recipients[0][email]=" + email;
- postData += "&files[0]=" + file;
- var data = Encoding.ASCII.GetBytes(postData);
- request.ContentType = "application/json";
- request.ContentLength = data.Length;
- using (var stream = request.GetRequestStream())
- {
- stream.Write(data, 0, data.Length);
- }
- HttpWebResponse response = (HttpWebResponse)request.GetResponse();
- return new StreamReader(response.GetResponseStream()).ReadToEnd();
- }
- }
Replies
Know the answer? Post it — somebody with the same question will find it here.