PowerBuilder / DocuSign REST API / Change one or more user in the specified account.
Back to Collection Items
integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_Json
oleobject loo_SbRequestBody
oleobject loo_Resp
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
destroy loo_Http
MessageBox("Error","Connecting to COM object failed")
return
end if
// Use this online tool to generate code from sample JSON: Generate Code to Create JSON
// The following JSON is sent in the request body.
// {
// "users": [
// {
// "userName": "sample string 1",
// "userId": "sample string 2",
// "userType": "sample string 3",
// "isAdmin": "sample string 4",
// "userStatus": "sample string 5",
// "uri": "sample string 6",
// "email": "sample string 7",
// "password": "sample string 8",
// "title": "sample string 9",
// "createdDateTime": "sample string 10",
// "firstName": "sample string 11",
// "middleName": "sample string 12",
// "lastName": "sample string 13",
// "suffixName": "sample string 14",
// "permissionProfileId": "sample string 15",
// "permissionProfileName": "sample string 16",
// "countryCode": "sample string 17",
// "subscribe": "sample string 18",
// "userSettings": [
// {}
// ],
// "accountManagementGranular": {
// "canManageUsers": "sample string 1",
// "canManageAdmins": "sample string 2",
// "canManageGroups": "sample string 3",
// "canManageSharing": "sample string 4",
// "canManageEnvelopeTransfer": "sample string 5",
// "canManageAccountSettings": "sample string 6",
// "canManageReporting": "sample string 7",
// "canManageAccountSecuritySettings": "sample string 8",
// "canManageSigningGroups": "sample string 9",
// "canManageDocumentRetention": "sample string 10",
// "canViewUsers": "sample string 11",
// "canManageUsersMetadata": {
// "rights": "sample string 1",
// "uiHint": "sample string 2",
// "uiType": "sample string 3",
// "uiOrder": "sample string 4",
// "is21CFRPart11": "sample string 5",
// "options": [
// "sample string 1"
// ]
// },
// "canManageAdminsMetadata": {},
// "canManageGroupsMetadata": {},
// "canManageSharingMetadata": {},
// "canManageEnvelopeTransferMetadata": {},
// "canManageAccountSettingsMetadata": {},
// "canManageReportingMetadata": {},
// "canManageAccountSecuritySettingsMetadata": {},
// "canManageSigningGroupsMetadata": {},
// "canManageDocumentRetentionMetadata": {},
// "canViewUsersMetadata": {}
// },
// "sendActivationOnInvalidLogin": "sample string 19",
// "activationAccessCode": "sample string 20",
// "enableConnectForUser": "sample string 21",
// "forgottenPasswordInfo": {
// "forgottenPasswordQuestion1": "sample string 1",
// "forgottenPasswordAnswer1": "sample string 2",
// "forgottenPasswordQuestion2": "sample string 3",
// "forgottenPasswordAnswer2": "sample string 4",
// "forgottenPasswordQuestion3": "sample string 5",
// "forgottenPasswordAnswer3": "sample string 6",
// "forgottenPasswordQuestion4": "sample string 7",
// "forgottenPasswordAnswer4": "sample string 8"
// },
// "groupList": [
// {
// "groupId": "sample string 1",
// "groupName": "sample string 2",
// "permissionProfileId": "sample string 3",
// "groupType": "sample string 4",
// "users": [
// {
// "userName": "sample string 1",
// "userId": "sample string 2",
// "email": "sample string 3",
// "userType": "sample string 4",
// "userStatus": "sample string 5",
// "uri": "sample string 6",
// "loginStatus": "sample string 7",
// "sendActivationEmail": "sample string 8",
// "activationAccessCode": "sample string 9"
// }
// ]
// }
// ],
// "workAddress": {
// "address1": "sample string 1",
// "address2": "sample string 2",
// "city": "sample string 3",
// "stateOrProvince": "sample string 4",
// "postalCode": "sample string 5",
// "phone": "sample string 6",
// "fax": "sample string 7",
// "country": "sample string 8"
// },
// "homeAddress": {},
// "loginStatus": "sample string 22",
// "passwordExpiration": "sample string 23",
// "lastLogin": "sample string 24",
// "sendActivationEmail": "sample string 25",
// "customSettings": [
// {}
// ],
// "profileImageUri": "sample string 26",
// "userProfileLastModifiedDate": "sample string 27",
// "signatureImageUri": "sample string 28",
// "initialsImageUri": "sample string 29",
// "jobTitle": "sample string 30"
// }
// ],
// "resultSetSize": "sample string 1",
// "totalSetSize": "sample string 2",
// "startPosition": "sample string 3",
// "endPosition": "sample string 4",
// "nextUri": "sample string 5",
// "previousUri": "sample string 6"
// }
loo_Json = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")
loo_Json.UpdateString("users[0].userName","sample string 1")
loo_Json.UpdateString("users[0].userId","sample string 2")
loo_Json.UpdateString("users[0].userType","sample string 3")
loo_Json.UpdateString("users[0].isAdmin","sample string 4")
loo_Json.UpdateString("users[0].userStatus","sample string 5")
loo_Json.UpdateString("users[0].uri","sample string 6")
loo_Json.UpdateString("users[0].email","sample string 7")
loo_Json.UpdateString("users[0].password","sample string 8")
loo_Json.UpdateString("users[0].title","sample string 9")
loo_Json.UpdateString("users[0].createdDateTime","sample string 10")
loo_Json.UpdateString("users[0].firstName","sample string 11")
loo_Json.UpdateString("users[0].middleName","sample string 12")
loo_Json.UpdateString("users[0].lastName","sample string 13")
loo_Json.UpdateString("users[0].suffixName","sample string 14")
loo_Json.UpdateString("users[0].permissionProfileId","sample string 15")
loo_Json.UpdateString("users[0].permissionProfileName","sample string 16")
loo_Json.UpdateString("users[0].countryCode","sample string 17")
loo_Json.UpdateString("users[0].subscribe","sample string 18")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsers","sample string 1")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageAdmins","sample string 2")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageGroups","sample string 3")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageSharing","sample string 4")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageEnvelopeTransfer","sample string 5")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageAccountSettings","sample string 6")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageReporting","sample string 7")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageAccountSecuritySettings","sample string 8")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageSigningGroups","sample string 9")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageDocumentRetention","sample string 10")
loo_Json.UpdateString("users[0].accountManagementGranular.canViewUsers","sample string 11")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.rights","sample string 1")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.uiHint","sample string 2")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.uiType","sample string 3")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.uiOrder","sample string 4")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.is21CFRPart11","sample string 5")
loo_Json.UpdateString("users[0].accountManagementGranular.canManageUsersMetadata.options[0]","sample string 1")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageAdminsMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageGroupsMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageSharingMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageEnvelopeTransferMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageAccountSettingsMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageReportingMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageAccountSecuritySettingsMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageSigningGroupsMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canManageDocumentRetentionMetadata")
loo_Json.UpdateNewObject("users[0].accountManagementGranular.canViewUsersMetadata")
loo_Json.UpdateString("users[0].sendActivationOnInvalidLogin","sample string 19")
loo_Json.UpdateString("users[0].activationAccessCode","sample string 20")
loo_Json.UpdateString("users[0].enableConnectForUser","sample string 21")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordQuestion1","sample string 1")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordAnswer1","sample string 2")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordQuestion2","sample string 3")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordAnswer2","sample string 4")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordQuestion3","sample string 5")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordAnswer3","sample string 6")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordQuestion4","sample string 7")
loo_Json.UpdateString("users[0].forgottenPasswordInfo.forgottenPasswordAnswer4","sample string 8")
loo_Json.UpdateString("users[0].groupList[0].groupId","sample string 1")
loo_Json.UpdateString("users[0].groupList[0].groupName","sample string 2")
loo_Json.UpdateString("users[0].groupList[0].permissionProfileId","sample string 3")
loo_Json.UpdateString("users[0].groupList[0].groupType","sample string 4")
loo_Json.UpdateString("users[0].groupList[0].users[0].userName","sample string 1")
loo_Json.UpdateString("users[0].groupList[0].users[0].userId","sample string 2")
loo_Json.UpdateString("users[0].groupList[0].users[0].email","sample string 3")
loo_Json.UpdateString("users[0].groupList[0].users[0].userType","sample string 4")
loo_Json.UpdateString("users[0].groupList[0].users[0].userStatus","sample string 5")
loo_Json.UpdateString("users[0].groupList[0].users[0].uri","sample string 6")
loo_Json.UpdateString("users[0].groupList[0].users[0].loginStatus","sample string 7")
loo_Json.UpdateString("users[0].groupList[0].users[0].sendActivationEmail","sample string 8")
loo_Json.UpdateString("users[0].groupList[0].users[0].activationAccessCode","sample string 9")
loo_Json.UpdateString("users[0].workAddress.address1","sample string 1")
loo_Json.UpdateString("users[0].workAddress.address2","sample string 2")
loo_Json.UpdateString("users[0].workAddress.city","sample string 3")
loo_Json.UpdateString("users[0].workAddress.stateOrProvince","sample string 4")
loo_Json.UpdateString("users[0].workAddress.postalCode","sample string 5")
loo_Json.UpdateString("users[0].workAddress.phone","sample string 6")
loo_Json.UpdateString("users[0].workAddress.fax","sample string 7")
loo_Json.UpdateString("users[0].workAddress.country","sample string 8")
loo_Json.UpdateNewObject("users[0].homeAddress")
loo_Json.UpdateString("users[0].loginStatus","sample string 22")
loo_Json.UpdateString("users[0].passwordExpiration","sample string 23")
loo_Json.UpdateString("users[0].lastLogin","sample string 24")
loo_Json.UpdateString("users[0].sendActivationEmail","sample string 25")
loo_Json.UpdateString("users[0].profileImageUri","sample string 26")
loo_Json.UpdateString("users[0].userProfileLastModifiedDate","sample string 27")
loo_Json.UpdateString("users[0].signatureImageUri","sample string 28")
loo_Json.UpdateString("users[0].initialsImageUri","sample string 29")
loo_Json.UpdateString("users[0].jobTitle","sample string 30")
loo_Json.UpdateString("resultSetSize","sample string 1")
loo_Json.UpdateString("totalSetSize","sample string 2")
loo_Json.UpdateString("startPosition","sample string 3")
loo_Json.UpdateString("endPosition","sample string 4")
loo_Json.UpdateString("nextUri","sample string 5")
loo_Json.UpdateString("previousUri","sample string 6")
// Adds the "Authorization: Bearer {{accessToken}}" header.
loo_Http.AuthToken = "{{accessToken}}"
loo_Http.SetRequestHeader("Accept","application/json")
loo_SbRequestBody = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbRequestBody.ConnectToNewObject("Chilkat.StringBuilder")
loo_Json.EmitSb(loo_SbRequestBody)
loo_Resp = loo_Http.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/users?allow_all_languages={{allow_all_languages}}",loo_SbRequestBody,"utf-8","application/json",0,0)
if loo_Http.LastMethodSuccess = 0 then
Write-Debug loo_Http.LastErrorText
destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody
return
end if
Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp
destroy loo_Http
destroy loo_Json
destroy loo_SbRequestBody
Curl Command
curl -X PUT
-H "Accept: application/json"
-H "Authorization: Bearer {{accessToken}}"
-d '{
"users": [
{
"userName": "sample string 1",
"userId": "sample string 2",
"userType": "sample string 3",
"isAdmin": "sample string 4",
"userStatus": "sample string 5",
"uri": "sample string 6",
"email": "sample string 7",
"password": "sample string 8",
"title": "sample string 9",
"createdDateTime": "sample string 10",
"firstName": "sample string 11",
"middleName": "sample string 12",
"lastName": "sample string 13",
"suffixName": "sample string 14",
"permissionProfileId": "sample string 15",
"permissionProfileName": "sample string 16",
"countryCode": "sample string 17",
"subscribe": "sample string 18",
"userSettings": [
{}
],
"accountManagementGranular": {
"canManageUsers": "sample string 1",
"canManageAdmins": "sample string 2",
"canManageGroups": "sample string 3",
"canManageSharing": "sample string 4",
"canManageEnvelopeTransfer": "sample string 5",
"canManageAccountSettings": "sample string 6",
"canManageReporting": "sample string 7",
"canManageAccountSecuritySettings": "sample string 8",
"canManageSigningGroups": "sample string 9",
"canManageDocumentRetention": "sample string 10",
"canViewUsers": "sample string 11",
"canManageUsersMetadata": {
"rights": "sample string 1",
"uiHint": "sample string 2",
"uiType": "sample string 3",
"uiOrder": "sample string 4",
"is21CFRPart11": "sample string 5",
"options": [
"sample string 1"
]
},
"canManageAdminsMetadata": {},
"canManageGroupsMetadata": {},
"canManageSharingMetadata": {},
"canManageEnvelopeTransferMetadata": {},
"canManageAccountSettingsMetadata": {},
"canManageReportingMetadata": {},
"canManageAccountSecuritySettingsMetadata": {},
"canManageSigningGroupsMetadata": {},
"canManageDocumentRetentionMetadata": {},
"canViewUsersMetadata": {}
},
"sendActivationOnInvalidLogin": "sample string 19",
"activationAccessCode": "sample string 20",
"enableConnectForUser": "sample string 21",
"forgottenPasswordInfo": {
"forgottenPasswordQuestion1": "sample string 1",
"forgottenPasswordAnswer1": "sample string 2",
"forgottenPasswordQuestion2": "sample string 3",
"forgottenPasswordAnswer2": "sample string 4",
"forgottenPasswordQuestion3": "sample string 5",
"forgottenPasswordAnswer3": "sample string 6",
"forgottenPasswordQuestion4": "sample string 7",
"forgottenPasswordAnswer4": "sample string 8"
},
"groupList": [
{
"groupId": "sample string 1",
"groupName": "sample string 2",
"permissionProfileId": "sample string 3",
"groupType": "sample string 4",
"users": [
{
"userName": "sample string 1",
"userId": "sample string 2",
"email": "sample string 3",
"userType": "sample string 4",
"userStatus": "sample string 5",
"uri": "sample string 6",
"loginStatus": "sample string 7",
"sendActivationEmail": "sample string 8",
"activationAccessCode": "sample string 9"
}
]
}
],
"workAddress": {
"address1": "sample string 1",
"address2": "sample string 2",
"city": "sample string 3",
"stateOrProvince": "sample string 4",
"postalCode": "sample string 5",
"phone": "sample string 6",
"fax": "sample string 7",
"country": "sample string 8"
},
"homeAddress": {},
"loginStatus": "sample string 22",
"passwordExpiration": "sample string 23",
"lastLogin": "sample string 24",
"sendActivationEmail": "sample string 25",
"customSettings": [
{}
],
"profileImageUri": "sample string 26",
"userProfileLastModifiedDate": "sample string 27",
"signatureImageUri": "sample string 28",
"initialsImageUri": "sample string 29",
"jobTitle": "sample string 30"
}
],
"resultSetSize": "sample string 1",
"totalSetSize": "sample string 2",
"startPosition": "sample string 3",
"endPosition": "sample string 4",
"nextUri": "sample string 5",
"previousUri": "sample string 6"
}'
https://domain.com/v2.1/accounts/{{accountId}}/users?allow_all_languages={{allow_all_languages}}
Postman Collection Item JSON
{
"name": "Change one or more user in the specified account.",
"request": {
"method": "PUT",
"header": [
{
"key": "Accept",
"value": "application/json"
},
{
"key": "Authorization",
"value": "Bearer {{accessToken}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"users\": [\n {\n \"userName\": \"sample string 1\",\n \"userId\": \"sample string 2\",\n \"userType\": \"sample string 3\",\n \"isAdmin\": \"sample string 4\",\n \"userStatus\": \"sample string 5\",\n \"uri\": \"sample string 6\",\n \"email\": \"sample string 7\",\n \"password\": \"sample string 8\",\n \"title\": \"sample string 9\",\n \"createdDateTime\": \"sample string 10\",\n \"firstName\": \"sample string 11\",\n \"middleName\": \"sample string 12\",\n \"lastName\": \"sample string 13\",\n \"suffixName\": \"sample string 14\",\n \"permissionProfileId\": \"sample string 15\",\n \"permissionProfileName\": \"sample string 16\",\n \"countryCode\": \"sample string 17\",\n \"subscribe\": \"sample string 18\",\n \"userSettings\": [\n {}\n ],\n \"accountManagementGranular\": {\n \"canManageUsers\": \"sample string 1\",\n \"canManageAdmins\": \"sample string 2\",\n \"canManageGroups\": \"sample string 3\",\n \"canManageSharing\": \"sample string 4\",\n \"canManageEnvelopeTransfer\": \"sample string 5\",\n \"canManageAccountSettings\": \"sample string 6\",\n \"canManageReporting\": \"sample string 7\",\n \"canManageAccountSecuritySettings\": \"sample string 8\",\n \"canManageSigningGroups\": \"sample string 9\",\n \"canManageDocumentRetention\": \"sample string 10\",\n \"canViewUsers\": \"sample string 11\",\n \"canManageUsersMetadata\": {\n \"rights\": \"sample string 1\",\n \"uiHint\": \"sample string 2\",\n \"uiType\": \"sample string 3\",\n \"uiOrder\": \"sample string 4\",\n \"is21CFRPart11\": \"sample string 5\",\n \"options\": [\n \"sample string 1\"\n ]\n },\n \"canManageAdminsMetadata\": {},\n \"canManageGroupsMetadata\": {},\n \"canManageSharingMetadata\": {},\n \"canManageEnvelopeTransferMetadata\": {},\n \"canManageAccountSettingsMetadata\": {},\n \"canManageReportingMetadata\": {},\n \"canManageAccountSecuritySettingsMetadata\": {},\n \"canManageSigningGroupsMetadata\": {},\n \"canManageDocumentRetentionMetadata\": {},\n \"canViewUsersMetadata\": {}\n },\n \"sendActivationOnInvalidLogin\": \"sample string 19\",\n \"activationAccessCode\": \"sample string 20\",\n \"enableConnectForUser\": \"sample string 21\",\n \"forgottenPasswordInfo\": {\n \"forgottenPasswordQuestion1\": \"sample string 1\",\n \"forgottenPasswordAnswer1\": \"sample string 2\",\n \"forgottenPasswordQuestion2\": \"sample string 3\",\n \"forgottenPasswordAnswer2\": \"sample string 4\",\n \"forgottenPasswordQuestion3\": \"sample string 5\",\n \"forgottenPasswordAnswer3\": \"sample string 6\",\n \"forgottenPasswordQuestion4\": \"sample string 7\",\n \"forgottenPasswordAnswer4\": \"sample string 8\"\n },\n \"groupList\": [\n {\n \"groupId\": \"sample string 1\",\n \"groupName\": \"sample string 2\",\n \"permissionProfileId\": \"sample string 3\",\n \"groupType\": \"sample string 4\",\n \"users\": [\n {\n \"userName\": \"sample string 1\",\n \"userId\": \"sample string 2\",\n \"email\": \"sample string 3\",\n \"userType\": \"sample string 4\",\n \"userStatus\": \"sample string 5\",\n \"uri\": \"sample string 6\",\n \"loginStatus\": \"sample string 7\",\n \"sendActivationEmail\": \"sample string 8\",\n \"activationAccessCode\": \"sample string 9\"\n }\n ]\n }\n ],\n \"workAddress\": {\n \"address1\": \"sample string 1\",\n \"address2\": \"sample string 2\",\n \"city\": \"sample string 3\",\n \"stateOrProvince\": \"sample string 4\",\n \"postalCode\": \"sample string 5\",\n \"phone\": \"sample string 6\",\n \"fax\": \"sample string 7\",\n \"country\": \"sample string 8\"\n },\n \"homeAddress\": {},\n \"loginStatus\": \"sample string 22\",\n \"passwordExpiration\": \"sample string 23\",\n \"lastLogin\": \"sample string 24\",\n \"sendActivationEmail\": \"sample string 25\",\n \"customSettings\": [\n {}\n ],\n \"profileImageUri\": \"sample string 26\",\n \"userProfileLastModifiedDate\": \"sample string 27\",\n \"signatureImageUri\": \"sample string 28\",\n \"initialsImageUri\": \"sample string 29\",\n \"jobTitle\": \"sample string 30\"\n }\n ],\n \"resultSetSize\": \"sample string 1\",\n \"totalSetSize\": \"sample string 2\",\n \"startPosition\": \"sample string 3\",\n \"endPosition\": \"sample string 4\",\n \"nextUri\": \"sample string 5\",\n \"previousUri\": \"sample string 6\"\n}"
},
"url": {
"raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/users?allow_all_languages={{allow_all_languages}}",
"host": [
"{{baseUrl}}"
],
"path": [
"v2.1",
"accounts",
"{{accountId}}",
"users"
],
"query": [
{
"key": "allow_all_languages",
"value": "{{allow_all_languages}}"
}
],
"variable": [
{
"key": "accountId",
"value": "{{accountId}}"
}
]
}
},
"response": [
]
}