Updating An Entity
To update an entity, we need to make the following HTTP request:

Request

1
PUT /api/v1/{entity-type}/{id}
Copied!
Field
In
Type
Description
content-type
header
string
Set to application/json
authorization
header
string
Set to bearer {access-token}
entity-type
path
string
The type of entity to modify
id
id
string
The ID of entity to modify
...
body
object
The entity's data

Response

This will update the entity in the registry and return the following object:
1
{
2
"id": "open-saber.registry.update",
3
"ver": "1.0",
4
"ets": 1634371946769,
5
"params": {
6
"resmsgid": "",
7
"msgid": "d51e6e6a-027d-4a42-84bb-2ce00e31d993",
8
"err": "",
9
"status": "SUCCESSFUL",
10
"errmsg": ""
11
},
12
"responseCode": "OK"
13
}
Copied!

Usage

cURL

1
curl --location \
2
--request 'PUT' \
3
--header 'content-type: application/json' \
4
--header 'authorization: bearer {access-token}' \
5
--data-raw '{
6
...updated-claims
7
}' \
8
'{registry-url}/api/v1/{entity-type}/{id}'
Copied!

HTTPie

1
echo '{
2
...updated-claims
3
}' | http put \
4
'{registry-url}/api/v1/{entity-type}/{id}' \
5
'content-type: application/json' \
6
'authorization: bearer {access-token}'
Copied!
{registry-url} is usually http://localhost:{port}. The port can be found under the rg section in the docker-compose.yaml file and is usually 8081.
Last modified 8d ago
Copy link
Edit on GitHub