Chilkat Online Tools

VBScript / DocuSign eSignature REST API / Sets a signature, initials, or stamps image.

Back to Collection Items

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = CreateObject("Chilkat_9_5_0.Http")

' Use this online tool to generate code from sample JSON: Generate Code to Create JSON

' The following JSON is sent in the request body.

' {}

set json = CreateObject("Chilkat_9_5_0.JsonObject")

http.SetRequestHeader "Content-Type","image/gif"
' Adds the "Authorization: Bearer {{accessToken}}" header.
http.AuthToken = "{{accessToken}}"
http.SetRequestHeader "Accept","application/json"

set sbRequestBody = CreateObject("Chilkat_9_5_0.StringBuilder")
success = json.EmitSb(sbRequestBody)

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}",sbRequestBody,"utf-8","image/gif",0,0)
If (http.LastMethodSuccess = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine(resp.StatusCode)
outFile.WriteLine(resp.BodyStr)


outFile.Close

Curl Command

curl -X PUT
	-H "Accept: application/json"
	-H "Content-Type: image/gif"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://domain.com/v2.1/accounts/{{accountId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}

Postman Collection Item JSON

{
  "name": "Sets a signature, initials, or stamps image.",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "image/gif"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "signatures",
        "{{signatureId}}",
        "{{imageType}}"
      ],
      "query": [
        {
          "key": "transparent_png",
          "value": "{{transparent_png}}"
        }
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}",
          "type": "string"
        },
        {
          "key": "imageType",
          "value": "{{imageType}}",
          "type": "string"
        },
        {
          "key": "signatureId",
          "value": "{{signatureId}}",
          "type": "string"
        }
      ]
    }
  },
  "response": [
  ]
}