Skip to main content

Update a Resource

Updates a Resource or a Contained Resource based on the request's body. The incoming representation of the resource will overwrite all the properties from the existing resource.

PUT /v1/:type/:id

Path Parameters

  • type - (required, string) specifies the type of the resource. Possible values are described in Resource Types.
  • id - (required, string) specifies the id of the resource. A resource can be fetched either by id or by any of its identifiers.

Request Body

The request body is a json object that contains contain some or all properties supported by the targeted resource type. When updating a resource, one must include all the required properties of the targeted Resource Type.

PUT /v1/clinic/cd429379-821e-42e1-8d4c-815349534670
{
"name": "Foot clinic",
"phone": [
{
"value": "5140902999",
"use": "reception",
"system": "phone",
"extension": null
}
],
"email": [
{
"value": "info@footclinic.com",
"use": "info",
"system": "email"
}
],
"openingHours": [
{
"day": 1,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 2,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 3,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 4,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 5,
"start": "08:00:00",
"end": "17:00:00"
}
]
}

Response

Returns 200 - OK with a Resource of the targeted type in the response body.

Example

200 OK on PUT /v1/clinic/cd429379-821e-42e1-8d4c-815349534670
{
"id": "cd429379-821e-42e1-8d4c-815349534670",
"createdAt": "2021-10-12T18:24:09.651074Z",
"updatedAt": "2021-10-12T18:24:09.651074Z",
"name": "Foot clinic",
"phone": [
{
"id": "phone-d13f82fa-2fd5-4422-8e29-dd4fec650440",
"value": "5140902999",
"use": "reception",
"system": "phone",
"extension": null
}
],
"email": [
{
"id": "email-35bfdca3-3e63-49e3-97b4-18979da37a0c",
"value": "info@footclinic.com",
"use": "info",
"system": "email"
}
],
"openingHours": [
{
"day": 1,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 2,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 3,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 4,
"start": "08:00:00",
"end": "17:00:00"
},
{
"day": 5,
"start": "08:00:00",
"end": "17:00:00"
}
]
}