Chilkat Online Tools

Powershell / DocuSign Admin API / Assign user to permission profiles for one or more products

Back to Collection Items

Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll"

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

$http = New-Object Chilkat.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.

# {}

$json = New-Object Chilkat.JsonObject

$http.SetRequestHeader("Content-Type","application/json")
# Adds the "Authorization: Bearer {{accessToken}}" header.
$http.AuthToken = "{{accessToken}}"
$http.SetRequestHeader("Accept","application/json")

$resp = $http.PostJson3("https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/products/users/{{userId}}/permission_profiles","application/json",$json)
if ($http.LastMethodSuccess -eq $false) {
    $($http.LastErrorText)
    exit
}

$($resp.StatusCode)
$($resp.BodyStr)

Curl Command

curl -X POST
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/products/users/{{userId}}/permission_profiles

Postman Collection Item JSON

{
  "name": "Assign user to permission profiles for one or more products",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/products/users/{{userId}}/permission_profiles",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2.1",
        "organizations",
        "{{organizationId}}",
        "accounts",
        "{{accountId}}",
        "products",
        "users",
        "{{userId}}",
        "permission_profiles"
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        },
        {
          "key": "accountId",
          "value": "{{accountId}}"
        },
        {
          "key": "userId",
          "value": "{{userId}}"
        }
      ]
    },
    "description": "Required scopes: user_write"
  },
  "response": [
  ]
}