Example in .NET

We're going to send an existing document with id 53 via post mail. In Color and as fast as possible!

    using (WebClient client = new WebClient()) {
           string jsonRequest = new JavaScriptSerializer().Serialize(new { speed = 1, color = 1 });
           client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
           string jsonResponse = string.Empty;
           try {
               jsonResponse = client.UploadString("https://api.pingen.com/document/send/id/30/token/MYTOKEN", jsonRequest);
               // parse json and handle it
           } catch (Exception e) {
               WebException we = e as WebException;
               if (we != null && we.Response != null)  {
                   var res = we.Response.GetResponseStream();
                   if (res != null) jsonResponse = new StreamReader(res).ReadToEnd();
               }
               // parse json (if available) and handle error
           }
       }