Making A Claim
To make a claim and send it for attestation, we need to make the following request:

Request

1
PUT /api/v1/{entity-type}/{id}/{field}?send=true
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
path
string
The ID of entity to modify
field
path
string
The field whose value we are sending for attestation
send
query
boolean
Set to true
...
body
any
The value of the claim

Response

This will send the claim for attestation 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": "ksi38Dsl-8dIw-492j-6vlS-84KRe0Csop35",
8
"err": "",
9
"status": "SUCCESSFUL",
10
"errmsg": ""
11
},
12
"responseCode": "OK"
13
}
Copied!
If you retrieve the entity by the Retrieve Entity API Endpoint, you will get the following object in response:
1
{
2
...claims
3
"osid": "{id}",
4
"osOwner": ["{owner-id}"],
5
"_osClaimId/{field}": "{claim-id}",
6
"_osState/{field}": "ATTESTATION_REQUESTED"
7
}
Copied!
Important variables in the response body:
Field
In
Type
Description
osOwner
body
string
User ID of the entity in Keycloak.
_osState/{field}
body
string
State of an attestable field. Can be DRAFT (when it has not been sent for attestation), ATTESTATION_REQUESTED (when sent for attestation), PUBLISHED (when successfully attested) and REJECTED (when rejected by the attestor)
_osClaimId/{field}
body
string
ID of the claim made on a field, required when attesting the claim.

Usage

cURL

1
curl --location \
2
--request 'PUT' \
3
--header 'content-type: application/json' \
4
--header 'authorization: bearer {access-token}' \
5
--data-raw '...field-value' \
6
'{registry-url}/api/v1/{entity-type}/{id}/{field}?send=true'
Copied!

HTTPie

1
echo '...field-value' | http put \
2
'{registry-url}/api/v1/{entity-type}/{id}/{field}' \
3
'content-type: application/json' \
4
'authorization: bearer {access-token}' \
5
'send==true'
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