이 엔드포인트를 사용하여 새 사용자를 만듭니다. 사용 가능한 액세스 역할을 받으려면 컨테이너 역할 목록 엔드포인트를 사용합니다.
기본값으로 사용자는 요청에서 사용한 API 키와 연결과 사용자와 동일한 컨테이너에 만듭니다.
curl -X POST \
https://www.digicert.com/services/v2/user \
-H 'Content-Type: application/json' \
-H 'X-DC-DEVKEY: {{api_key}}' \
-d '{
"first_name": "Jill",
"last_name": "Valentine",
"email": "jill.valentine@pd.racoon-city.gov",
"telephone": "555-555-5555",
"job_title": "S.T.A.R.S. Alpha Team",
"username": "jill.valentine",
"container": {
"id": 93288
},
"access_roles": [
{
"id": 5
}
]
}'
import requests
url = "https://www.digicert.com/services/v2/user"
payload = "{\n \"first_name\": \"Jill\",\n \"last_name\": \"Valentine\",\n \"email\": \"jill.valentine@pd.racoon-city.gov\",\n \"telephone\": \"555-555-5555\",\n \"job_title\": \"S.T.A.R.S. Alpha Team\",\n \"username\": \"jill.valentine\",\n \"container\": {\n \"id\": 93288\n },\n \"access_roles\": [\n {\n \"id\": 5\n }\n ]\n}"
headers = {
'X-DC-DEVKEY': "{{api_key}}",
'Content-Type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://www.digicert.com/services/v2/user"
payload := strings.NewReader("{\n \"first_name\": \"Jill\",\n \"last_name\": \"Valentine\",\n \"email\": \"jill.valentine@pd.racoon-city.gov\",\n \"telephone\": \"555-555-5555\",\n \"job_title\": \"S.T.A.R.S. Alpha Team\",\n \"username\": \"jill.valentine\",\n \"container\": {\n \"id\": 93288\n },\n \"access_roles\": [\n {\n \"id\": 5\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
var request = require("request");
var options = { method: 'POST',
url: 'https://www.digicert.com/services/v2/user',
headers:
{ 'Content-Type': 'application/json',
'X-DC-DEVKEY': '{{api_key}}' },
body:
{ first_name: 'Jill',
last_name: 'Valentine',
email: 'jill.valentine@pd.racoon-city.gov',
telephone: '555-555-5555',
job_title: 'S.T.A.R.S. Alpha Team',
username: 'jill.valentine',
container: { id: 93288 },
access_roles: [ { id: 5 } ] },
json: true };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"id": 1538858
}
이름 | 필수/옵션 | 유형 | 설명 |
---|---|---|---|
username | 필수 | string |
프로필에 대한 사용자 이름입니다. 유효한 문자: a—z A—Z 0—9 @ - _ + . |
first_name | 필수 | string |
사용자의 이름(성 제외)입니다. 글자 제한: 128 |
last_name | 필수 | string |
사용자의 성입니다. 글자 제한: 128 |
필수 | string |
사용자의 이메일 주소입니다. 유효한 이메일 주소만 수락합니다. 글자 제한: 255 |
|
job_title | 옵션 | string |
사용자의 직함입니다. EV 승인자가 되려는 사용자에 필수입니다. 글자 제한: 64 |
telephone | 옵션 | string |
사용자의 전화 번호입니다. EV 승인자가 되려는 사용자에 필수입니다. 글자 제한: 64 |
container | 필수 | object | |
.. id | 필수 | int | 사용자가 만들어지는 컨테이너의 ID입니다. |
access_roles | 필수 | array | |
.. id | 필수 | int |
사용자에게 할당된 액세스 역할의 ID입니다. 용어집 — 액세스 역할을 참조하십시오. |
container_id_assignments | 필수 | array | 사용자가 할당될 컨테이너 ID의 목록입니다. 설정된 경우, 사용자가 볼 수 있는 기본값 컨테이너를 재정의합니다. |
이름 | 유형 | 설명 |
---|---|---|
id | int | 만든 사용자의 ID입니다. |