Use this endpoint to update container (division) assignments for a user.
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.
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"
]
}'
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)
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))
}
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);
});
// empty
Name | Req/Opt | Type | Description |
---|---|---|---|
user_id | required | string | User ID. |
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. |