Update An Entity

To update an entity, we need to make the following HTTP request

Updating an Entity

PUT /api/v1/{entity-type}/{id}

Path Parameters

Headers

Request Body

{
	"id": "sunbird-rc.registry.update",
	"ver": "1.0",
	"ets": 1634371946769,
	"params": {
		"resmsgid": "",
		"msgid": "d51e6e6a-027d-4a42-84bb-2ce00e31d993",
		"err": "",
		"status": "SUCCESSFUL",
		"errmsg": ""
	},
	"responseCode": "OK"
}

Usage

cURL

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}'

HTTPie

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 the registry section in the docker-compose.yml file and is usually 8081.

Last updated

Copyright (c) 2023 EkStep Foundation under MIT License