Android / DocuSign REST API / Updates the user signature image or user initials image for the specified user.
Back to Collection Items
// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;
import android.app.Activity;
import com.chilkatsoft.*;
import android.widget.TextView;
import android.os.Bundle;
public class SimpleActivity extends Activity {
private static final String TAG = "Chilkat";
// Called when the activity is first created.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http = new CkHttp();
boolean success;
http.SetRequestHeader("Content-Type","image/gif");
// Adds the "Authorization: Bearer {{accessToken}}" header.
http.put_AuthToken("{{accessToken}}");
http.SetRequestHeader("Accept","application/json");
CkHttpResponse resp = http.QuickRequest("PUT","https://domain.com/v2.1/accounts/{{accountId}}/users/{{userId}}/signatures/{{signatureId}}/{{imageType}}?transparent_png={{transparent_png}}");
if (http.get_LastMethodSuccess() == false) {
Log.i(TAG, http.lastErrorText());
return;
}
Log.i(TAG, String.valueOf(resp.get_StatusCode()));
Log.i(TAG, resp.bodyStr());
}
static {
System.loadLibrary("chilkat");
// Note: If the incorrect library name is passed to System.loadLibrary,
// then you will see the following error message at application startup:
//"The application <your-application-name> has stopped unexpectedly. Please try again."
}
}
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}}"
},
{
"key": "imageType",
"value": "{{imageType}}"
},
{
"key": "signatureId",
"value": "{{signatureId}}"
},
{
"key": "userId",
"value": "{{userId}}"
}
]
},
"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": [
]
}