Create DID Reservation#
Description
Creates a DID Reservation.
Request#
HTTP Method: POST
URI Path: /v3/did_reservations
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
include |
|
Optional |
Request Body Object Attributes:
Name |
Type |
Is Required? |
Nullable |
Description |
|---|---|---|---|---|
include |
|
Optional |
True |
Request Body Object Relationships:
Title |
Type |
Description |
|---|---|---|
available_dids |
Linkage for included available DIDs. |
Example#
http
1POST /v3/did_reservations HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API token]
6
7 {
8 "data": {
9 "type": "did_reservations",
10 "attributes": {
11 "description": "DIDWW"
12 },
13 "relationships": {
14 "available_did": {
15 "data": {
16 "type": "available_dids",
17 "id": "8bc37f63-acd7-4e43-a760-1a1caa6e4683"
18 }
19 }
20 }
21 }
22 }
curl
1curl -i -X POST https://api.didww.com/v3/did_reservations -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"description": "DIDWW"}, "relationships": {"available_did": {"data": {"id": "8bc37f63-acd7-4e43-a760-1a1caa6e4683", "type": "available_dids"}}}, "type": "did_reservations"}}'
response
1HTTP/1.1 201 Created
2Content-Type: application/vnd.api+json
3
4 {
5 "data": {
6 "id": "80167e78-62a1-4720-bf00-229fa7e1935d",
7 "type": "did_reservations",
8 "links": {
9 "self": "https://api.didww.com/v3/did_reservations/80167e78-62a1-4720-bf00-229fa7e1935d"
10 },
11 "attributes": {
12 "expire_at": "2018-03-15 12:34:56",
13 "created_at": "2018-03-15 12:14:56",
14 "description": "DIDWW"
15 },
16 "relationships": {
17 "available_did": {
18 "links": {
19 "self": "https://api.didww.com/v3/did_reservations/80167e78-62a1-4720-bf00-229fa7e1935d/relationships/available_did",
20 "related": "https://api.didww.com/v3/did_reservations/80167e78-62a1-4720-bf00-229fa7e1935d/available_did"
21 }
22 }
23 }
24 }
25 }
Other Responses#
Code |
Success |
Description |
|---|---|---|
201 |
Yes |
Created DID Reservation with not reserved Available DID. Returns DID Reservation Object |
202 |
Yes |
Updated DID Reservation with already reserved Available DID. Request updates current reservation if exists. Returns DID Reservation Object |
422 |
No |
|
401 |
No |