Chilkat Online Tools

delphiDll / DocuSign eSignature REST API / Updates the user signature image or user initials image for the specified user.

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
resp: HCkHttpResponse;

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

http := CkHttp_Create();

CkHttp_SetRequestHeader(http,'Content-Type','image/gif');
// Adds the "Authorization: Bearer {{accessToken}}" header.
CkHttp_putAuthToken(http,'{{accessToken}}');
CkHttp_SetRequestHeader(http,'Accept','application/json');

resp := CkHttp_QuickRequest(http,'PUT','https://domain.com/v2.1/accounts/{{accountId}}/users/{{userId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}');
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

Memo1.Lines.Add(IntToStr(CkHttpResponse_getStatusCode(resp)));
Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
CkHttpResponse_Dispose(resp);

CkHttp_Dispose(http);

Curl Command

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

Postman Collection Item JSON

{
  "name": "Updates the user signature image or user initials image for the specified user.",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "image/gif"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
      ]
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/users/{{userId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "users",
        "{{userId}}",
        "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"
        },
        {
          "key": "userId",
          "value": "{{userId}}",
          "type": "string"
        }
      ]
    },
    "description": "Updates the user signature image or user initials image for the specified user. The supported image formats for this file are: gif, png, jpeg, and bmp. The file must be less than 200K.\n\nThe userId property specified in the endpoint must match the authenticated user's user ID and the user must be a member of the account.\n\nThe `signatureId` parameter accepts a signature ID or a signature name. DocuSign recommends you use signature ID (`signatureId`), since some names contain characters that do not properly encode into a URL. If you use the user name, it is likely that the name includes spaces. In that case, URL encode the name before using it in the endpoint. \n\nFor example encode \"Bob Smith\" as \"Bob%20Smith\".\n"
  },
  "response": [
  ]
}