사용자 목록

PUT
https://www.digicert.com/services/v2/user/{{user_id}}/container-assignments

Use this endpoint to update container (division) assignments for a user.

  • Users with container assignments are restricted users. Restricted users can only access the containers to which they are assigned.
  • Users with no container assignments are unrestricted users. Unrestricted users can access all containers within their account.

This is a destructive operation. In the request body, values in the container_id_assignments array overwrite any existing container assignments for the given user_id. Passing an empty array removes all container assignments.

To get a user's existing container assignments, call the User info API and check the value of the container_assignments array.

Example requests and responses

cURL
curl --request PUT 'https://www.digicert.com/services/v2/user/{{user_id}}/container-assignments' \
--header 'X-DC-DEVKEY: {{api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "container_id_assignments": [
    "577532",
    "577533"
  ]
}'
Python
import requests
import json

url = "https://www.digicert.com/services/v2/user/{{user_id}}/container-assignments"

payload = json.dumps({
  "container_id_assignments": [
    "577532",
    "577533"
  ]
})
headers = {
  'X-DC-DEVKEY': {{api_key}},
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
Go
package main

import (
		"fmt"
		"strings"
		"net/http"
		"io/ioutil"
)

func main() {

		url := "https://www.digicert.com/services/v2/user/{{user_id}}/container-assignments"
		method := "PUT"

		payload := strings.NewReader(`{
  "container_id_assignments": [
    "577532",
    "577533"
  ]
}`)

		client := &http.Client {
		}
		req, err := http.NewRequest(method, url, payload)

		if err != nil {
				fmt.Println(err)
				return
		}
		req.Header.Add("X-DC-DEVKEY", {{api_key}})
		req.Header.Add("Content-Type", "application/json")

		res, err := client.Do(req)
		if err != nil {
				fmt.Println(err)
				return
		}
		defer res.Body.Close()

		body, err := ioutil.ReadAll(res.Body)
		if err != nil {
				fmt.Println(err)
				return
		}
		fmt.Println(string(body))
}
NodeJS
var request = require('request');
var options = {
  'method': 'PUT',
  'url': 'https://www.digicert.com/services/v2/user/{{user_id}}/container-assignments',
  'headers': {
    'X-DC-DEVKEY': {{api_key}},
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "container_id_assignments": [
      "577532",
      "577533"
    ]
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
204 No Content
// empty

Path parameters

Name Req/Opt Type Description
user_id required string User ID.

Request parameters

Name Type Description
container_id_assignments array of strings List of container (division) IDs. To get a list of containers in your account, use the List containers API.