Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Remove empty bullet, typo

This is the technical API documentation (focusing on client devs) for the REST Module. For general REST web service information and user documentation, see that the module page.

Table of Contents

Resources

Every available object in the web services (ws) module is written up as a resource. The resource class defines the properties that are exposed and the setters that are available. The class also defines the representations and what goes in them (ref vs default vs full, see below for more on representations).

...

Both the REST and Java API follow the same default behaviour except for the case of getting metadata from the Java API, see the summary table below:

REST APIJava API

GET dataresourceexcludes voided by default

getAll[Data] excludes voided by default

GET metadataresource excludes retired by default

getAll[Metadata] includes retired by default


Date/Time with Time Zones

It is strongly recommended to always submit the full date + time + timezone in any REST POST query.

The format of the date/time should be: 

2016-12-25T19:02:34.232+0700

(the milliseconds are optional)

e.g.

Code Block
titleCreating an obs
POST /ws/rest/v1/obs
Body content:
{"obsDatetime": "2016-12-25T19:02:34.232+0700", /*... and other properties */}

If no time zone is provided or it is not formatted correctly, the service will suppose that the date and time are provided at local time (server time). This can have deep repercussions, so make sure to always send a valid time zone.

...