Chilkat Online Tools

DataFlex / DocuSign Admin API / Import request for adding users to accounts within the organization.

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vJson
    Handle hoJson
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

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

    // The following JSON is sent in the request body.

    // {}

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End

    Send ComSetRequestHeader To hoHttp "Content-Type" "multipart/form-data"
    // Adds the "Authorization: Bearer {{accessToken}}" header.
    Set ComAuthToken Of hoHttp To "{{accessToken}}"
    Send ComSetRequestHeader To hoHttp "Accept" "application/json"

    Get pvComObject of hoJson to vJson
    Get ComPostJson3 Of hoHttp "https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/imports/bulk_users/add" "multipart/form-data" vJson To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -X POST
	-H "Accept: application/json"
	-H "Content-Type: multipart/form-data"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/imports/bulk_users/add

Postman Collection Item JSON

{
  "name": "Import request for adding users to accounts within the organization.",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "multipart/form-data"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/imports/bulk_users/add",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2",
        "organizations",
        "{{organizationId}}",
        "imports",
        "bulk_users",
        "add"
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        }
      ]
    },
    "description": "Required scopes: user_write"
  },
  "response": [
  ]
}