Comment on page
Update An Entity
To update an entity, we need to make the following HTTP request
put
/api/v1/{entity-type}/{id}
Updating an Entity
Parameters
Path
entity-type*
The type of entity to modify
id*
The ID of entity to modify
Header
authorization
Set to Bearer {access-token} if roles in schema is not anonymous. Else token can be empty
content-type*
Set to
application/json
Body
...*
The entity's data
Responses
200: OK
Updated Entity Success Response
curl --location \
--request 'PUT' \
--header 'content-type: application/json' \
--header 'authorization: bearer {access-token}' \
--data-raw '{
"phoneNumber": "1234567891",
"school": "UP Public School",
"subject": "Math",
"name": "Pranav Agate",
}' \
'{registry-url}/api/v1/{entity-type}/{id}'
printf '{
"phoneNumber": "1234567891",
"school": "UP Public School",
"subject": "Math",
"name": "Pranav Agate",
}' | http put \
'{registry-url}/api/v1/{entity-type}/{id}' \
'content-type: application/json' \
'authorization: bearer {access-token}'
{registry-url}
is usually http://localhost:{port}. The port can be found under theregistry
section in thedocker-compose.yml
file and is usually8081
.
Last modified 1yr ago