Public Resource Access

Get a public resource

  • Sandbox: available
  • Staging: available
  • Production: unknown
GET
/public/{token}

Reads a FHIR resource through its public token, without a bearer token. Use it to share one resource, such as a form or a document, with people who have no Ovok account.

Auth: none. The public token in the path is the credential: anyone with it can read the resource.

Behaviour

  • A resource becomes public when it gets a token in meta.extension, with the URL https://api.ovok.com/fhir/StructureDefinition/public-resource-token. Use PATCH /public/{resourceType}/{id} to give a resource a token.
  • The token names exactly one resource. The response is that resource as stored, including its meta.extension.
  • A token stops working when the resource's token is replaced or deleted, or when the resource is deleted.

Example

curl 'https://api.sandbox.ovok.com/public/example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'

Path Parameters

token*string

Response Body

The FHIR resource the token points to.

application/json
  1. response

The FHIR resource as stored in Medplum.

resourceType*string

FHIR resource type.

id*string

FHIR resource id.

[key: string]?any
Example Request
curl -X GET 'https://api.sandbox.ovok.com/public/string'
Example Response
{  "resourceType": "string",  "id": "string"}

Update current project features PATCH

Replaces the Medplum features (`Project.features`) of your current project with the list you send. **Auth:** bearer token of a project admin. The caller must also be a Practitioner, an admin or hold the System Owner access policy. **Scope:** the caller's project (from the token). ## Behaviour - The list replaces the stored one; it is not merged. Send every feature you want enabled. Sending the same list twice has the same result. - Each value must be one of the FHIR `Project.features` codes. - The write only succeeds if the project did not change since the server read it; otherwise it answers 409. ## Example ```bash curl -X PATCH 'https://api.sandbox.ovok.com/v1/projects/me/features' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "features": ["bots", "cron", "websocket-subscriptions"] }' ```

Change public resource token PATCH

Gives a resource a new public token, so it can be read with `GET /public/{token}`. If the resource already has a token, the old one is replaced and stops working. **Auth:** bearer token of a project admin. ## Behaviour - The resource must be in the caller's project or one of its sub-projects. A resource of any other project, the parent project included, answers `403` and is left unchanged; an unknown id answers `404`. - The token is written to the resource's `meta.extension` with the URL `https://api.ovok.com/fhir/StructureDefinition/public-resource-token`. Other extensions are kept. - The response is `{ token, resource }`: the new token and the updated resource. ## Example ```bash curl -X PATCH 'https://api.sandbox.ovok.com/public/DocumentReference/87ea5dfc-8b8e-384d-8489-79496e706390' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` ```json { "token": "...", "resource": { "resourceType": "DocumentReference", "id": "87ea5dfc-8b8e-384d-8489-79496e706390", "meta": { "extension": [ { "url": "https://api.ovok.com/fhir/StructureDefinition/public-resource-token", "valueString": "..." } ] }, ... } } ```