diff --git a/src/commonmark/en/content/developer/web-api.md b/src/commonmark/en/content/developer/web-api.md index 342ca702d..ecb770cbb 100644 --- a/src/commonmark/en/content/developer/web-api.md +++ b/src/commonmark/en/content/developer/web-api.md @@ -1,22398 +1,22 @@ -# Web API - - - -The Web API is a component which makes it possible for external systems -to access and manipulate data stored in an instance of DHIS2. More -precisely, it provides a programmatic interface to a wide range of -exposed data and service methods for applications such as third-party -software clients, web portals and internal DHIS2 modules. - -## Introduction - - - -The Web API adheres to many of the principles behind the REST -architectural style. To mention some few and important ones: - -1. The fundamental building blocks are referred to as *resources*. A - resource can be anything exposed to the Web, from a document to a - business process - anything a client might want to interact with. - The information aspects of a resource can be retrieved or exchanged - through resource *representations*. A representation is a view of a - resource's state at any given time. For instance, the *reportTable* - resource in DHIS2 represents a tabular report of aggregated data for - a certain set of parameters. This resource can be retrieved in a - variety of representation formats including HTML, PDF, and MS Excel. - -2. All resources can be uniquely identified by a *URI* (also referred - to as *URL*). All resources have a default representation. You can - indicate that you are interested in a specific representation by - supplying an *Accept* HTTP header, a file extension or a *format* - query parameter. So in order to retrieve the PDF representation of a - report table you can supply an *Accept: application/pdf* header or - append *.pdf* or *?format=pdf* to your request URL. - -3. Interactions with the API requires the correct use of HTTP *methods* or - *verbs*. This implies that for a resource you must issue a *GET* - request when you want to retrieve it, *POST* request when you want - to create one, *PUT* when you want to update it and *DELETE* when - you want to remove it. So if you want to retrieve the default - representation of a report table you can send a GET request to e.g. - */reportTable/iu8j/hYgF6t*, where the last part is the report table - identifier. - -4. Resource representations are *linkable*, meaning that - representations advertise other resources which are relevant to the - current one by embedding links into itself (please be aware that you - need to request *href* in your field filter to have this working. - This feature greatly improves the usability and robustness of the - API as we will see later. For instance, you can easily navigate to - the indicators which are associated with a report table from the - *reportTable* resource through the embedded links using your - preferred representation format. - -While all of this might sound complicated, the Web API is actually very -simple to use. We will proceed with a few practical examples in a -minute. - -## Authentication - - - -The DHIS2 Web API supports two protocols for authentication, Basic -Authentication and OAuth 2. You can verify and get information about the -currently authenticated user by making a GET request to the following -URL: - - /api/33/me - -And more information about authorities (and if a user has a certain -authority) by using the endpoints: - - /api/33/me/authorities - /api/33/me/authorities/ALL - -### Basic Authentication - - - -The DHIS2 Web API supports *Basic authentication*. Basic authentication -is a technique for clients to send login credentials over HTTP to a web -server. Technically speaking, the username is appended with a colon and -the password, Base64-encoded, prefixed Basic and supplied as the value -of the *Authorization* HTTP header. More formally that is: - - Authorization: Basic base64encode(username:password) - -Most network-aware development environments provide support for Basic -authentication, such as *Apache HttpClient* and *Spring RestTemplate*. -An important note is that this authentication scheme provides no security -since the username and password are sent in plain text and can be easily -observed by an attacker. Using Basic is recommended only if the server is -using SSL/TLS (HTTPS) to encrypt communication with clients. Consider this -a hard requirement in order to provide secure interactions with the Web -API. - -### Two-factor authentication - - - -DHIS2 supports two-factor authentication. This can be enabled per user. -When enabled, users will be asked to enter a 2FA code when logging in. You -can read more about 2FA [here](https://www.google.com/landing/2step/). - -### OAuth2 - - - -DHIS2 supports the *OAuth2* authentication protocol. OAuth2 is an open -standard for authorization which allows third-party clients to -connect on behalf of a DHIS2 user and get a reusable *bearer token* for -subsequent requests to the Web API. DHIS2 does not support fine-grained -OAuth2 roles but rather provides applications access based on user roles -of the DHIS2 user. - -Each client for which you want to allow OAuth 2 authentication must be -registered in DHIS2. To add a new OAuth2 client go to `Apps > Settings > OAuth2 Clients` -in the user interface, click *Add new* and enter the desired client name and the grant types. - -#### Adding a client using the Web API - -An OAuth2 client can be added through the Web API. As an example, we can -send a payload like this: - -```json -{ - "name": "OAuth2 Demo Client", - "cid": "demo", - "secret": "1e6db50c-0fee-11e5-98d0-3c15c2c6caf6", - "grantTypes": [ - "password", - "refresh_token", - "authorization_code" - ], - "redirectUris": [ - "http://www.example.org" - ] -} -``` - -The payload can be sent with the following command: - -```bash -SERVER="https://play.dhis2.org/dev" -curl -X POST -H "Content-Type: application/json" -d @client.json - -u admin:district "$SERVER/api/oAuth2Clients" -``` - -We will use this client as the basis for our next grant type examples. - -#### Grant type password - - - -The simplest of all grant types is the *password* grant type. This -grant type is similar to basic authentication in the sense that it -requires the client to collect the user's username and password. As an -example we can use our demo server: - -```bash -SERVER="https://play.dhis2.org/dev" -SECRET="1e6db50c-0fee-11e5-98d0-3c15c2c6caf6" - -curl -X POST -H "Accept: application/json" -u demo:$SECRET "$SERVER/uaa/oauth/token" - -d grant_type=password -d username=admin -d password=district -``` - -This will give you a response similar to this: - -```json -{ - "expires_in": 43175, - "scope": "ALL", - "access_token": "07fc551c-806c-41a4-9a8c-10658bd15435", - "refresh_token": "a4e4de45-4743-481d-9345-2cfe34732fcc", - "token_type": "bearer" -} -``` - -For now, we will concentrate on the `access_token`, which is what we -will use as our authentication (bearer) token. As an example, we will get -all data elements using our token: - -```bash -SERVER="https://play.dhis2.org/dev" -curl -H "Authorization: Bearer 07fc551c-806c-41a4-9a8c-10658bd15435" "$SERVER/api/33/dataElements.json" -``` - -#### Grant type refresh\_token - - - -In general the access tokens have limited validity. You can have a look -at the `expires_in` property of the response in the previous example -to understand when a token expires. To get a fresh `access_token` you -can make another round trip to the server and use `refresh_token` -which allows you to get an updated token without needing to ask for the -user credentials one more time. - -```bash -SERVER="https://play.dhis2.org/dev" -SECRET="1e6db50c-0fee-11e5-98d0-3c15c2c6caf6" -REFRESH_TOKEN="a4e4de45-4743-481d-9345-2cfe34732fcc" - -curl -X POST -H "Accept: application/json" -u demo:$SECRET "$SERVER/uaa/oauth/token" - -d "grant_type=refresh_token" -d "refresh_token=$REFRESH_TOKEN" -``` - -The response will be exactly the same as when you get a token to start with. - -#### Grant type authorization_code - - - -Authorized code grant type is the recommended approach if you don't want -to store the user credentials externally. It allows DHIS2 to collect the -username/password directly from the user instead of the client -collecting them and then authenticating on behalf of the user. Please be -aware that this approach uses the `redirectUris` part of the client -payload. - -Step 1: Visit the following URL using a web browser. If you have more than one -redirect URIs, you might want to add `&redirect_uri=http://www.example.org` -to the URL: - -```bash -SERVER="https://play.dhis2.org/dev" -$SERVER/uaa/oauth/authorize?client_id=demo&response_type=code -``` - -Step 2: After the user has successfully logged in and accepted your -client access, it will redirect back to your redirect uri like this: - - http://www.example.org/?code=XYZ - -Step 3: This step is similar to what we did in the password grant type, -using the given code, we will now ask for an access token: - -```bash -SERVER="https://play.dhis2.org/dev" -SECRET="1e6db50c-0fee-11e5-98d0-3c15c2c6caf6" - -curl -X POST -u demo:$SECRET -H "Accept: application/json" $SERVER/uaa/oauth/token --d "grant_type=authorization_code" -d "code=XYZ" -``` - -## Error and info messages - - - -The Web API uses a consistent format for all error/warning and -informational messages: - -```json -{ - "httpStatus": "Forbidden", - "message": "You don't have the proper permissions to read objects of this type.", - "httpStatusCode": 403, - "status": "ERROR" -} -``` - -Here we can see from the message that the user tried to access a -resource I did not have access to. It uses the http status code 403, the -http status message *forbidden* and a descriptive message. - -
Name | -Description | -
---|---|
httpStatus | -HTTP Status message for this response, see RFC 2616 (Section 10) for more information. | -
httpStatusCode | -HTTP Status code for this response, see RFC 2616 (Section 10) for more information. | -
status | -DHIS2 status, possible values are OK | WARNING | ERROR, where `OK` means everything was successful, `ERROR` means that operation did not complete and `WARNING` means the operation was partially successful, if the message contains a `response` property, please look there for more information. | -
message | -A user-friendly message telling whether the operation was a success or not. | -
devMessage | -A more technical, developer-friendly message (not currently in use). | -
response | -Extension point for future extension to the WebMessage format. This will be documented when it starts being used. | -
Interval | -Format | -Example | -Description | -
---|---|---|---|
Day | -yyyyMMdd | -20040315 | -March 15, 2004 | -
Week | -yyyyWn | -2004W10 | -Week 10 2004 | -
Week Wednesday | -yyyyWedWn | -2015WedW5 | -Week 5 with start Wednesday | -
Week Thursday | -yyyyThuWn | -2015ThuW6 | -Week 6 with start Thursday | -
Week Saturday | -yyyySatWn | -2015SatW7 | -Week 7 with start Saturday | -
Week Sunday | -yyyySunWn | -2015SunW8 | -Week 8 with start Sunday | -
Bi-week | -yyyyBiWn | -2015BiW1 | -Week 1-2 20015 | -
Month | -yyyyMM | -200403 | -March 2004 | -
Bi-month | -yyyyMMB | -200401B | -January-February 2004 | -
Quarter | -yyyyQn | -2004Q1 | -January-March 2004 | -
Six-month | -yyyySn | -2004S1 | -January-June 2004 | -
Six-month April | -yyyyAprilSn | -2004AprilS1 | -April-September 2004 | -
Year | -yyyy | -2004 | -2004 | -
Financial Year April | -yyyyApril | -2004April | -Apr 2004-Mar 2005 | -
Financial Year July | -yyyyJuly | -2004July | -July 2004-June 2005 | -
Financial Year Oct | -yyyyOct | -2004Oct | -Oct 2004-Sep 2005 | -
Scheme | -Description | -
---|---|
ID, UID | -Match on DHIS2 stable Identifier, this is the default id scheme. | -
CODE | -Match on DHIS2 Code, mainly used to exchange data with an external system. | -
NAME | -Match on DHIS2 Name, please note that this uses what is available as object.name, and not the translated name. Also note that names are not always unique, and in that case, they can not be used. | -
ATTRIBUTE:ID | -Match on metadata attribute, this attribute needs to be assigned to the type you are matching on, and also that the unique property is set to true. The main usage of this is also to exchange data with external systems, it has some advantages over CODE since multiple attributes can be added, so it can be used to synchronize with more than one system. | -
Param | -Option values | -Default option | -Description | -
---|---|---|---|
paging | -true | false | -true | -Indicates whether to return lists of elements in pages. | -
page | -number | -1 | -Defines which page number to return. | -
pageSize | -number | -50 | -Defines the number of elements to return for each page. | -
order | -property:asc/iasc/desc/idesc | -- | Order the output using a specified order, only properties that are both persisted and simple (no collections, idObjects etc) are supported. iasc and idesc are case insensitive sorting. | -
Parameter | -Values | -Description | -
---|---|---|
translate | -true | false | -Translate display* properties in metadata output (displayName, displayShortName, displayDescription, and displayFormName for data elements). Default value is true. | -
locale | -Locale to use | -Translate metadata output using a specified locale (requires translate=true). | -
Operator | -Types | -Value required | -Description | -
---|---|---|---|
eq | -string | boolean | integer | float | enum | collection (checks for size) | date | -true | -Equality | -
!eq | -string | boolean | integer | float | enum | collection (checks for size) | date | -true | -Inequality | -
ne | -string | boolean | integer | float | enum | collection (checks for size) | date | -true | -Inequality | -
like | -string | -true | -Case sensitive string, match anywhere | -
!like | -string | -true | -Case sensitive string, not match anywhere | -
\$like | -string | -true | -Case sensitive string, match start | -
!\$like | -string | -true | -Case sensitive string, not match start | -
like\$ | -string | -true | -Case sensitive string, match end | -
!like\$ | -string | -true | -Case sensitive string, not match end | -
ilike | -string | -true | -Case insensitive string, match anywhere | -
!ilike | -string | -true | -Case insensitive string, not match anywhere | -
\$ilike | -string | -true | -Case insensitive string, match start | -
!\$ilike | -string | -true | -Case insensitive string, not match start | -
ilike\$ | -string | -true | -Case insensitive string, match end | -
!ilike\$ | -string | -true | -Case insensitive string, not match end | -
gt | -string | boolean | integer | float | collection (checks for size) | date | -true | -Greater than | -
ge | -string | boolean | integer | float | collection (checks for size) | date | -true | -Greater than or equal | -
lt | -string | boolean | integer | float | collection (checks for size) | date | -true | -Less than | -
le | -string | boolean | integer | float | collection (checks for size) | date | -true | -Less than or equal | -
null | -all | -false | -Property is null | -
!null | -all | -false | -Property is not null | -
empty | -collection | -false | -Collection is empty | -
token | -string | -true | -Match on multiple tokens in search property | -
!token | -string | -true | -Not match on multiple tokens in search property | -
in | -string | boolean | integer | float | date | -true | -Find objects matching 1 or more values | -
!in | -string | boolean | integer | float | date | -true | -Find objects not matching 1 or more values | -
Operator | -Description | -
---|---|
<field-name> | -Include property with name, if it exists. | -
<object>[<field-name>, ...] | -Includes a field within either a collection (will be applied to every object in that collection), or just on a single object. | -
!<field-name>, <object>[!<field-name> | -Do not include this field name, it also works inside objects/collections. Useful when you use a preset to include fields. | -
*, <object>[*] | -Include all fields on a certain object, if applied to a collection, it will include all fields on all objects on that collection. | -
:<preset> | -Alias to select multiple fields. Three presets are currently available, see the table below for descriptions. | -
Preset | -Description | -
---|---|
all | -All fields of the object | -
* | -Alias for all | -
identifiable | -Includes id, name, code, created and lastUpdated fields | -
nameable | -Includes id, name, shortName, code, description, created and lastUpdated fields | -
persisted | -Returns all persisted property on an object, does not take into consideration if the object is the owner of the relation. | -
owner | -Returns all persisted property on an object where the object is the owner of all properties, this payload can be used to update through the API. | -
Name | -Arguments | -Description | -
---|---|---|
size | -- | Gives sizes of strings (length) and collections | -
isEmpty | -- | Is string or collection empty | -
isNotEmpty | -- | Is string or collection not empty | -
rename | -Arg1: name | -Renames the property name | -
paging | -Arg1: page,Arg2: pageSize | -Pages a collection, default pageSize is 50. | -
pluck | -Optional Arg1: fieldName | -Converts an array of objects to an array of a selected field of that object. By default, the first field that is returned by the collection is used (normally the ID). | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
preheatCache | -boolean | -false | -true | false | -Turn cache-map preheating on/off. This is on by default, turning this off will make initial load time for importer much shorter (but will make the import itself slower). This is mostly used for cases where you have a small XML/JSON file you want to import, and don't want to wait for cache-map preheating. | -
strategy | -enum | -false | -CREATE_AND_UPDATE | CREATE | UPDATE | DELETE | -Import strategy to use, see below for more information. | -
mergeMode | -enum | -false | -REPLACE, MERGE | -Strategy for merging of objects when doing updates. REPLACE will just overwrite the property with the new value provided, MERGE will only set the property if it is not null (only if the property was provided). | -
Name | -Options | -Description | -
---|---|---|
fields | -Same as metadata field filter | -Default field filter to apply for all types, default is `:owner`. | -
filter | -Same as metadata object filter | -Default object filter to apply for all types, default is `none`. | -
order | -Same as metadata order | -Default order to apply to all types, default is `name` if available, or `created` if not. | -
translate | -false/true | -Enable translations. Be aware that this is turned off by default (in other endpoints this is on by default). | -
locale | -<locale> | -Change from user locale, to your own custom locale. | -
defaults | -INCLUDE/EXCLUDE | -Should auto-generated category object be included or not in the payload. If you are moving metadata between 2 non-synced instances, it might make sense to set this to EXCLUDE to ease the handling of these generated objects. | -
skipSharing | -false/true | -Enabling this will strip the sharing properties from the exported objects. This includes user, publicAccess, userGroupAccesses, userAccesses, and externalAccess. | -
download | -false/true | -Enabling this will add HTTP header Content-Disposition that specifies that the data should be handled as an attachment and will be offered by web browsers as a download. | -
Name | -Options | -Description | -
---|---|---|
skipSharing | -false/true | -Enabling this will strip the sharing properties from the exported objects. This includes user, publicAccess, userGroupAccesses, userAccesses, and externalAccess. | -
download | -false/true | -Enabling this will add HTTP header Content-Disposition that specifies that the data should be handled as an attachment and will be offered by web browsers as a download. | -
Name | -Options (first is default) | -Description | -
---|---|---|
importMode | -COMMIT, VALIDATE | -Sets overall import mode, decides whether or not to only `VALIDATE` or also `COMMIT` the metadata, this has similar functionality as our old dryRun flag. | -
identifier | -UID, CODE, AUTO | -Sets the identifier scheme to use for reference matching. `AUTO` means try `UID` first, then `CODE`. | -
importReportMode | -ERRORS, FULL, DEBUG | -Sets the `ImportReport` mode, controls how much is reported back after the import is done. `ERRORS` only includes ObjectReports for object which has errors. `FULL` returns an ObjectReport for all objects imported, and `DEBUG` returns the same plus a name for the object (if available). | -
preheatMode | -REFERENCE, ALL, NONE | -Sets the preheater mode, used to signal if preheating should be done for `ALL` (as it was before with preheatCache=true) or do a more intelligent scan of the objects to see what to preheat (now the default), setting this to `NONE` is not recommended. | -
importStrategy | -CREATE_AND_UPDATE, CREATE, UPDATE, DELETE | -Sets import strategy, `CREATE_AND_UPDATE` will try and match on identifier, if it doesn't exist, it will create the object. | -
atomicMode | -ALL, NONE | -Sets atomic mode, in the old importer we always did a best effort import, which means that even if some references did not exist, we would still import (i.e. missing data elements on a data element group import). Default for new importer is to not allow this, and similar reject any validation errors. Setting the `NONE` mode emulated the old behavior. | -
mergeMode | -REPLACE, MERGE | -Sets the merge mode, when doing updates we have two ways of merging the old object with the new one, `MERGE` mode will only overwrite the old property if the new one is not-null, for `REPLACE` mode all properties are overwritten regardless of null or not. | -
flushMode | -AUTO, OBJECT | -Sets the flush mode, which controls when to flush the internal cache. It is strongly recommended to keep this to `AUTO` (which is the default). Only use `OBJECT` for debugging purposes, where you are seeing hibernate exceptions and want to pinpoint the exact place where the stack happens (hibernate will only throw when flushing, so it can be hard to know which object had issues). | -
skipSharing | -false, true | -Skip sharing properties, does not merge sharing when doing updates, and does not add user group access when creating new objects. | -
skipValidation | -false, true | -Skip validation for import. `NOT RECOMMENDED`. | -
async | -false, true | -Asynchronous import, returns immediately with a Location header pointing to the location of the importReport. The payload also contains a json object of the job created. | -
inclusionStrategy | -NON_NULL, ALWAYS, NON_EMPTY | -NON_NULL includes properties which are not null, ALWAYS include all properties, NON_EMPTY includes non empty properties (will not include strings of 0 length, collections of size 0, etc.) | -
userOverrideMode | -NONE, CURRENT, SELECTED | -Allows you to override the user property of every object you are importing, the options are NONE (do nothing), CURRENT (use import user), SELECTED (select a specific user using overrideUser=X) | -
overrideUser | -User ID | -If userOverrideMode is SELECTED, use this parameter to select the user you want override with. | -
Name | -Values | -Description | -
---|---|---|
uid | -- | Object uid to query by (can be more than one) | -
code | -- | Object code to query by (can be more than one) | -
klass | -- | Object class to query by (can be more than one), please note that the full java package name is required here (to avoid name collisions) | -
createdAt | -- | Query by creation date | -
createdBy | -- | Query by who made the change (username) | -
type | -CREATE, UPDATE, DELETE | -Query by audit type | -
Metadata type | -Available RenderingTypes | -
---|---|
Program Stage Section | -
|
-
Data element | -
|
-
Value type | -Is object an optionset? | -RenderingTypes allowed | -
---|---|---|
TRUE_ONLY | -No | -DEFAULT, VERTICAL_RADIOBUTTONS, HORIZONTAL_RADIOBUTTONS, VERTICAL_CHECKBOXES, HORIZONTAL_CHECKBOXES, TOGGLE | -
BOOLEAN | -No | -- |
- | -Yes | -DEFAULT, DROPDOWN, VERTICAL_RADIOBUTTONS, HORIZONTAL_RADIOBUTTONS, VERTICAL_CHECKBOXES, HORIZONTAL_CHECKBOXES, SHARED_HEADER_RADIOBUTTONS, ICONS_AS_BUTTONS, SPINNER, ICON | -
INTEGER | -No | -DEFAULT, VALUE, SLIDER, LINEAR_SCALE, SPINNER | -
INTEGER_POSITIVE | -No | -- |
INTEGER_NEGATIVE | -No | -- |
INTEGER_ZERO_OR_POSITIVE | -No | -- |
NUMBER | -No | -- |
UNIT_INTERVAL | -No | -- |
PERCENTAGE | -No | -- |
Property | -Description | -Type | -
---|---|---|
type | -The RenderingType of the object, as seen in the first table. This property is the same for both value type and program stage section, but is the only property available for program stage section. | -Enum (See list in the Metadata and Rendering Type table) | -
min | -Only for value type rendering. Represents the minimum value this field can have. | -Integer | -
max | -Only for value type rendering. Represents the maximum value this field can have. | -Integer | -
step | -Only for value type rendering. Represents the size of the steps the value should increase, for example for SLIDER og LINEAR_SCALE | -Integer | -
decimalPoints | -Only for value type rendering. Represents the number of decimal points the value should use. | -Integer | -
Property | -Description | -Type | -
---|---|---|
color | -A color, represented by a hexadecimal. | -String (#000000) | -
icon | -An icon, represented by a icon-name. | -String | -
Variable | -Object | -Description | -
---|---|---|
#{<dataelement-id>.<categoryoptcombo-id>.<attributeoptcombo-id>} | -Data element operand | -Refers to a combination of an aggregate data element and a category option combination. Both category and attribute option combo ids are optional, and a wildcard "*" symbol can be used to indicate any value. | -
#{<dataelement-id>.<categoryoptiongroup-id>.<attributeoptcombo-id>} | -Category Option Group | -Refers to an aggregate data element and a category option group, containing multiple category option combinations. | -
#{<dataelement-id>} | -Aggregate data element | -Refers to the total value of an aggregate data element across all category option combinations. | -
D{<program-id>.<dataelement-id>} | -Program data element | -Refers to the value of a tracker data element within a program. | -
A{<program-id>.<attribute-id>} | -Program tracked entity attribute | -Refers to the value of a tracked entity attribute within a program. | -
I{<program-indicator-id>} | -Program indicator | -Refers to the value of a program indicator. | -
R{<dataset-id>.<metric>} | -Reporting rate | -Refers to a reporting rate metric. The metric can be REPORTING_RATE, REPORTING_RATE_ON_TIME, ACTUAL_REPORTS, ACTUAL_REPORTS_ON_TIME, EXPECTED_REPORTS. | -
C{<constant-id>} | -Constant | -Refers to a constant value. | -
N{<indicator-id>} | -Indicator | -Refers to an existing Indicator. | -
OUG{<orgunitgroup-id>} | -Organisation unit group | -Refers to the count of organisation units within an organisation unit group. | -
Variable | -Description | -
---|---|
#{<programstage-id>.<dataelement-id>} | -Refers to a combination of program stage and data element id. | -
A{<attribute-id>} | -Refers to a tracked entity attribute. | -
V{<variable-id>} | -Refers to a program variable. | -
C{<constant-id>} | -Refers to a constant. | -
Query parameter | -Options | -Description | -
---|---|---|
userOnly | -false | true | -Data capture organisation units associated with current user only. | -
userDataViewOnly | -false | true | -Data view organisation units associated with current user only. | -
userDataViewFallback | -false | true | -Data view organisation units associated with current user only with fallback to data capture organisation units. | -
query | -string | -Query against the name, code and ID properties. | -
level | -integer | -Organisation units at the given level in the hierarchy. | -
maxLevel | -integer | -Organisation units at the given max level or levels higher up in the hierarchy. | -
withinUserHierarchy | -false | true | -Limits search and retrieval to organisation units that are within the users data capture scope. | -
withinUserSearchHierarchy | -false | true | -Limits search and retrieval to organisation units that are within the current users search scope. Note: "withinUserHierarchy", if true, takes higher precedence. | -
memberCollection | -string | -For displaying count of members within a collection, refers to the name of the collection associated with organisation units. | -
memberObject | -UID | -For displaying count of members within a collection, refers to the identifier of the object member of the collection. | -
Query parameter | -Options | -Description | -
---|---|---|
includeChildren | -false | true | -Include immediate children of the specified organisation unit, i.e. the units at the immediate level below in the subhierarchy. | -
includeDescendants | -false | true | -Include all children of the specified organisation unit, i.e. all units in the sub-hierarchy. | -
includeAncestors | -false | true | -Include all parents of the specified organisation unit. | -
level | -integer | -Include children of the specified organisation unit at the given level of the sub-hierarchy (relative to the organisation unit where the immediate level below is level 1). | -
name | -description | -Compulsory | -
---|---|---|
program | -The program of which the programRule is executed in. | -Compulsory | -
name | -The name with which the program rule will be displayed to dhis2 configurators. Not visible to the end user of the program. | -Compulsory | -
description | -The description of the program rule, can be used by configurators to describe the rule. Not visible to the end user of the program. | -Compulsory | -
programStage | -If a programStage is set for a program rule, the rule will only be evaluated inside the specified program stage. | -optional | -
condition | -The expression that needs to be evaluated to true in order for the program rule to trigger its child actions. The expression is written using operators, function calls, hard coded values, constants and program rule variables.
-
|
-Compulsory | -
priority | -The priority to run the rule in cases where the order of the rules matters. In most cases the rules does not depend on being run before or after other rules, and in these cases the priority can be omitted. If no priority is set, the rule will be run after any rules that has a priority defined. If a priority(integer) is set, the rule with the lowest priority will be run before rules with higher priority. | -optional | -
name | -description | -Compulsory | -
---|---|---|
programRule | -The programRule that is the parent of this action. | -Compulsory | -
programRule- ActionType | -The type of action that is to be performed.
-
|
-Compulsory | -
location | -Used for actionType DISPLAYKEYVALUEPAIR and DISPLAYTEXT to designate which widget to display the text or keyvaluepair in. Compulsory for DISPLAYKEYVALUEPAIR and DISPLAYTEXT. | -See description | -
content | -Used for user messages in the different actions. See the actionType overview for a detailed explanation for how it is used in each of the action types. Compulsory for SHOWWARNING, SHOWERROR, WARNINGONCOMPLETION, ERRORONCOMPLETION, DISPLAYTEXT and DISPLAYKEYVALUEPAIR. Optional for HIDEFIELD and ASSIGN. | -See description | -
data | -Used for expressions in the different actions. See the actionType overview for a detailed explanation for how it is used in each of the action types. Compulsory for ASSIGN. Optional for SHOWWARNING, SHOWERROR, WARNINGONCOMPLETION, ERRORONCOMPLETION, DISPLAYTEXT, CREATEEVENT and DISPLAYKEYVALUEPAIR | -See description | -
dataElement | -Used for linking rule actions to dataElements. See the actionType overview for a detailed explanation for how it is used in each of the action types. Optional for SHOWWARNING, SHOWERROR, WARNINGONCOMPLETION, ERRORONCOMPLETION, ASSIGN and HIDEFIELD | -See description | -
trackedEntity- Attribute | -Used for linking rule actions to trackedEntityAttributes. See the actionType overview for a detailed explanation for how it is used in each of the action types. Optional for SHOWWARNING, SHOWERROR and HIDEFIELD. | -See description | -
option | -Used for linking rule actions to options. See the actionType overview for a detailed explanation for how it is used in each of the action types. Optional for HIDEOPTION | -See description | -
optionGroup | -Used for linking rule actions to optionGroups. See the actionType overview for a detailed explanation for how it is used in each of the action types. Compulsory for SHOWOPTIONGROUP, HIDEOPTIONGROUP. | -See description | -
programStage | -Only used for CREATEEVENT rule actions. Compulsory for CREATEEEVENT. | -See description | -
programStage- Section | -Only used for HIDESECTION rule actions. Compulsory for HIDESECTION | -See description | -
name | -description | -Compulsory | -
---|---|---|
name | -the name for the programRuleVariable - this name is used in expressions.
-
|
-Compulsory | -
sourceType | -Defines how this variable is populated with data from the enrollment and events.
-
|
-Compulsory | -
dataElement | -Used for linking the programRuleVariable to a dataElement. Compulsory for all sourceTypes that starts with DATAELEMENT_. | -See description | -
trackedEntity- Attribute | -Used for linking the programRuleVariable to a trackedEntityAttribute. Compulsory for sourceType TEI_ATTRIBUTE. | -See description | -
useCodeFor- OptionSet | -If checked, the variable will be populated with the code - not the name - from any linked option set. Default is unchecked, meaning that the name of the option is populated. | -- |
programStage | -Used for specifying a specific program stage to retreive the programRuleVariable value from. Compulsory for DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE. | -See description | -
Parameter | -Option | -Description | -
---|---|---|
pe | -ISO period | -Period for which to populate form data values. | -
ou | -UID | -Organisation unit for which to populate form data values. | -
metaData | -false | true | -Whether to include metadata about each data element of form sections. | -
Field name | -Description | -
---|---|
name | -unique name of document | -
external | -flag identifying the location of the document. TRUE for external files, FALSE for internal ones | -
url | -the location of the file. URL for external files. File resource id for internal ones (see File resources) | -
Key | -Value (default first) | -Description | -
---|---|---|
amqp.mode | -EMBEDDED | NATIVE |
- The default EMBEDDED starts up an internal AMQP service when the
- DHIS2 instance is starting up. If you want to connect to an external AMQP service
- you need to set the mode to NATIVE . |
-
amqp.host | -127.0.0.1 |
- Host to bind to. | -
amqp.port | -15672 |
- If mode is EMBEDDED then start the embedded server on this port,
- if NATIVE then the client will use this port to connect to. |
-
amqp.username | -guest |
- Username to connect to if using NATIVE mode. |
-
amqp.password | -guest |
- Password to connect to if using NATIVE mode. |
-
amqp.embedded.persistence | -false | true |
- If mode is EMBEDDED , this property controls persistence of
- the internal queue. |
-
Object type | -Class key | -
---|---|
Data elements | -DATA_ELEMENT | -
Data element groups | -DATA_ELEMENT_GROUP - |
Category options | -CATEGORY_OPTION | -
Category option groups | -CATEGORY_OPTION_GROUP | -
Organisation units | -ORGANISATION_UNIT | -
Organisation unit groups | -ORGANISATION_UNIT_GROUP | -
Validation rules | -VALIDATION_RULE | -
Option sets | -OPTION_SET | -
Translations | -TRANSLATION | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -Name | -Yes | -- | Name. Max 230 char. Unique. | -
2 | -UID | -No | -UID | -Stable identifier. Exactly 11 alpha-numeric characters, beginning with a character. Will be generated by system if not specified. | -
3 | -Code | -No | -- | Stable code. Max 50 char. | -
4 | -Short name | -No | -50 first char of name | -Will fall back to first 50 characters of name if unspecified. Max 50 char. Unique. | -
5 | -Description | -No | -- | Free text description. | -
6 | -Form name | -No | -- | Max 230 char. | -
7 | -Domain type | -No | -AGGREGATE | TRACKER | -Domain type for data element, can be aggregate or tracker. Max 16 char. | -
8 | -Value type | -No | -INTEGER | NUMBER | UNIT_INTERVAL | PERCENTAGE | INTEGER_POSITIVE | INTEGER_NEGATIVE | INTEGER_ZERO_OR_POSITIVE | FILE_RESOURCE | COORDINATE |TEXT | LONG_TEXT | LETTER | PHONE_NUMBER | EMAIL | BOOLEAN | TRUE_ONLY | DATE | DATETIME | -Value type. Max 16 char. | -
9 | -Aggregation type | -No | -SUM | AVERAGE | AVERAGE_SUM_ORG_UNIT | COUNT | STDDEV | VARIANCE | MIN | MAX | NONE | -Aggregation type indicating how to aggregate data in various dimensions. Max 16 char. | -
10 | -Category combination | -No | -UID | -UID of category combination. Will default to default category combination if not specified. | -
11 | -Url | -No | -- | URL to data element resource. Max 255 char. | -
12 | -Zero is significant | -No | -false | true | -Indicates whether zero values will be stored for this data element. | -
13 | -Option set | -No | -UID | -UID of option set to use for data. | -
14 | -Comment option set | -No | -UID | -UID of option set to use for comments. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -Name | -Yes | -- | Name. Max 230 characters. Unique. | -
2 | -UID | -No | -UID | -Stable identifier. Max 11 char. Will be generated by system if not specified. | -
3 | -Code | -No | -- | Stable code. Max 50 char. | -
4 | -Parent | -No | -UID | -UID of parent organisation unit. | -
5 | -Short name | -No | -50 first char of name | -Will fall back to first 50 characters of name if unspecified. Max 50 characters. Unique. | -
6 | -Description | -No | -- | Free text description. | -
7 | -Opening date | -No | -1970-01-01 | -Opening date of organisation unit in YYYY-MM-DD format. | -
8 | -Closed date | -No | -- | Closed date of organisation unit in YYYY-MM-DD format, skip if currently open. | -
9 | -Comment | -No | -- | Free text comment for organisation unit. | -
10 | -Feature type | -No | -NONE | MULTI_POLYGON | POLYGON | POINT | SYMBOL | -Geospatial feature type. | -
11 | -Coordinates | -No | -- | Coordinates used for geospatial analysis in Geo JSON format. | -
12 | -URL | -No | -- | URL to organisation unit resource. Max 255 char. | -
13 | -Contact person | -No | -- | Contact person for organisation unit. Max 255 char. | -
14 | -Address | -No | -- | Address for organisation unit. Max 255 char. | -
15 | -No | -- | Email for organisation unit. Max 150 char. | -|
16 | -Phone number | -No | -- | Phone number for organisation unit. Max 150 char. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -Name | -Yes | -- | Name. Max 230 characters. Unique. | -
2 | -UID | -No | -UID | -Stable identifier. Max 11 char. Will be generated by system if not specified. | -
3 | -Code | -No | -- | Stable code. Max 50 | -
4 | -Description | -No | -- | Free text description. | -
5 | -Instruction | -No | -- | Free text instruction. | -
6 | -Importance | -No | -MEDIUM | HIGH | LOW | -Importance of validation rule. | -
7 | -Rule type (ignored) | -No | -VALIDATION | SURVEILLANCE | -Type of validation rule. | -
8 | -Operator | -No | -equal_to | not_equal_to | greater_than | greater_than_or_equal_to | less_than | less_than_or_equal_to | compulsory_pair | exclusive_pair | -Expression operator. | -
9 | -Period type | -No | -Monthly | Daily | Weekly | Quarterly | SixMontly | Yearly | -Period type. | -
10 | -Left side expression | -Yes | -- | Mathematical formula based on data element and option combo UIDs. | -
11 | -Left side expression description | -Yes | -- | Free text. | -
12 | -Left side missing value strategy | -No | -SKIP_IF_ANY_VALUE_MISSING | SKIP_IF_ALL_VALUES_MISSING | NEVER_SKIP | -Behavior in case of missing values in left side expression. | -
13 | -Right side expression | -Yes | -- | Mathematical formula based on data element and option combo UIDs. | -
14 | -Right side expression description | -Yes | -- | Free text. | -
15 | -Right side missing value strategy | -No | -SKIP_IF_ANY_VALUE_MISSING | SKIP_IF_ALL_VALUES_MISSING | NEVER_SKIP | -Behavior in case of missing values in right side expression. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -OptionSetName | -Yes | -- | Name. Max 230 characters. Unique. Should be repeated for each option. | -
2 | -OptionSetUID | -No | -UID | -Stable identifier. Max 11 char. Will be generated by system if not specified. Should be repeated for each option. | -
3 | -OptionSetCode | -No | -- | Stable code. Max 50 char. Should be repeated for each option. | -
4 | -OptionName | -Yes | -- | Option name. Max 230 characters. | -
5 | -OptionUID | -No | -UID | -Stable identifier. Max 11 char. Will be generated by system if not specified. | -
6 | -OptionCode | -Yes | -- | Stable code. Max 50 char. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -OptionGroupName | -Yes | -Name. Max 230 characters. Unique. Should be repeated for each option. | -|
2 | -OptionGroupUid | -No | -Stable identifier. Max 11 char. Will be generated by system if not specified. Should be repeated for each option. | -|
3 | -OptionGroupCode | -No | -Stable code. Max 50 char. Should be repeated for each option. | -|
4 | -OptionGroupShortName | -Yes | -Short Name. Max 50 characters. Unique. Should be repeated for each option. | -|
5 | -OptionSetUid | -Yes | -Stable identifier. Max 11 char. Should be repeated for each option. | -|
6 | -OptionUid | -No | -Stable identifier. Max 11 char. | -|
7 | -OptionCode | -No | -Stable code. Max 50 char. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -OptionGroupSetName | -Yes | -Name. Max 230 characters. Unique. Should be repeated for each option. | -|
2 | -OptionGroupSetUid | -No | -Stable identifier. Max 11 char. Will be generated by system if not specified. Should be repeated for each option. | -|
3 | -OptionGroupSetCode | -No | -Stable code. Max 50 char. Should be repeated for each option. | -|
4 | -OptionGroupSetDescription | -No | -Description. Should be repeated for each option. | -|
5 | -DataDimension | -No | -TRUE, FALSE | -|
6 | -OptionSetUid | -No | -OptionSet UID. Stable identifier. Max 11 char. | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -UID | -Yes | -UID | -The UID of the collection to add an object to | -
2 | -UID | -Yes | -UID | -The UID of the object to add to the collection | -
Index | -Column | -Required | -Value (default first) | -Description | -
---|---|---|---|---|
1 | -Name | -Yes | -- | Name. Max 230 characters. Unique. | -
2 | -UID | -No | -UID | -Stable identifier. Max 11 chars. Will be generated by system if not specified. | -
3 | -Code | -No | -- | Stable code. Max 50 char. | -
4 | -Short name | -No | -- | Short name. Max 50 characters. | -
Name | -Required | -Description | -
---|---|---|
versionName | -false | -If this parameter is not specified, it will return the current version of the system or otherwise it will return the details of the versionName passed as parameter. (versionName is of the syntax "Version_<id>" | -
Name |
-Required |
-Description |
-
---|---|---|
baseline |
-false |
-If this parameter is not specified, it will return list of all metadata versions. Otherwise we need to pass a versionName parameter of the form "Version_<id>". It will then return the list of versions present in the system which were created after the version name supplied as the query parameter. |
-
Name |
-Required |
-Description |
-
---|---|---|
type |
-true |
-The type of metadata version which needs to be created. -
|
-
Name |
-Required |
-Description |
-
---|---|---|
versionName |
-true |
-Path parameter of the form "Version_<id>" so that the API downloads the specific version |
-
Name |
-Required |
-Description |
-
---|---|---|
versionName |
-true |
-versionName query parameter of the form "Version_<id>" . The api downloads this version from the remote server and imports it in the local system. |
-
Parameter | -Values (default first) | -Description | -
---|---|---|
dataElementIdScheme | -id | name | code | attribute:ID | -Property of the data element object to use to map the data values. | -
orgUnitIdScheme | -id | name | code | attribute:ID | -Property of the org unit object to use to map the data values. | -
categoryOptionComboIdScheme | -id | name | code | attribute:ID | -Property of the category option combo and attribute option combo objects to use to map the data values. | -
idScheme | -id | name | code| attribute:ID | -Property of all objects including data elements, org units and category option combos, to use to map the data values. | -
preheatCache | -false | true | -Indicates whether to preload metadata caches before starting to import data values, will speed up large import payloads with high metadata cardinality. | -
dryRun | -false | true | -Whether to save changes on the server or just return the import summary. | -
importStrategy | -CREATE | UPDATE | CREATE_AND_UPDATE | DELETE | -Save objects of all, new or update import status on the server. | -
skipExistingCheck | -false | true | -Skip checks for existing data values. Improves performance. Only use for empty databases or when the data values to import do not exist already. | -
skipAudit | -false | true | -Skip audit, meaning audit values will not be generated. Improves performance at the cost of ability to audit changes. Requires authority "F_SKIP_DATA_IMPORT_AUDIT". | -
async | -false | true | -Indicates whether the import should be done asynchronous or synchronous. The former is suitable for very large imports as it ensures that the request does not time out, although it has a significant performance overhead. The latter is faster but requires the connection to persist until the process is finished. | -
force | -false | true | -Indicates whether the import should be forced. Data import could be rejected for various reasons of data set locking for example due to approval, data input period, expiry days, etc. In order to override such locks and force data input one can use data import with force=true. However, one needs to be a *superuser* for this parameter to work. | -
Value type | -Requirements | -Comment | -
---|---|---|
BOOLEAN | -true | True | TRUE | false | False | FALSE | 1 | 0 | t | f | | -Used when the value is a boolean, true or false value. The import service does not care if the input begins with an uppercase or lowercase letter, or if it's all uppercase. | -
Column | -Required | -Description | -
Data element | -Yes | -Refers to ID by default, can also be name and code based on selected id scheme | -
Period | -Yes | -In ISO format | -
Org unit | -Yes | -Refers to ID by default, can also be name and code based on selected id scheme | -
Category option combo | -No | -Refers to ID | -
Attribute option combo | -No | -Refers to ID (from version 2.16) | -
Value | -No | -Data value | -
Stored by | -No | -Refers to username of user who entered the value | -
Last updated | -No | -Date in ISO format | -
Comment | -No | -Free text comment | -
Follow up | -No | -true or false | -
Query parameter | -Required | -Description | -
---|---|---|
period | -No | -Period to use, will be included without any checks. | -
orgUnit | -No | -Organisation unit to use, supports multiple orgUnits, both id and code can be used. | -
comment | -No | -Should comments be include, default: Yes. | -
orgUnitIdScheme | -No | -Organisation unit scheme to use, supports id | code. | -
dataElementIdScheme | -No | -Data-element scheme to use, supports id | code. | -
Parameter | -Description | -
---|---|
dataSet | -Data set identifier. Can be repeated any number of times. | -
dataElementGroup | -Data element group identifier. Can be repeated any number of times. | -
period | -Period identifier in ISO format. Can be repeated any number of times. | -
startDate | -Start date for the time span of the values to export. | -
endDate | -End date for the time span of the values to export. | -
orgUnit | -Organisation unit identifier. Can be repeated any number of times. | -
children | -Whether to include the children in the hierarchy of the organisation units. | -
orgUnitGroup | -Organisation unit group identifier. Can be repeated any number of times. | -
attributeOptionCombo | -Attribute option combo identifier. Can be repeated any number of times. | -
includeDeleted | -Whether to include deleted data values. | -
lastUpdated | -Include only data values which are updated since the given time stamp. | -
lastUpdatedDuration | -Include only data values which are updated within the given duration. The format is <value><time-unit>, where the supported time units are "d" (days), "h" (hours), "m" (minutes) and "s" (seconds). | -
limit | -The max number of results in the response. | -
idScheme | -Property of meta data objects to use for data values in response. | -
dataElementIdScheme | -Property of the data element object to use for data values in response. | -
orgUnitIdScheme | -Property of the org unit object to use for data values in response. | -
categoryOptionComboIdScheme | -Property of the category option combo and attribute option combo objects to use for data values in response. | -
dataSetIdScheme | -Property of the data set object to use in the response. | -
Query parameter | -Required | -Description | -
---|---|---|
de | -Yes | -Data element identifier | -
pe | -Yes | -Period identifier | -
ou | -Yes | -Organisation unit identifier | -
co | -No | -Category option combo identifier, default will be used if omitted | -
cc | -No (must be combined with cp) | -Attribute category combo identifier | -
cp | -No (must be combined with cc) | -Attribute category option identifiers, separated with ; for multiple values | -
ds | -No | -Data set, to check if POST or DELETE is allowed for period and organisation unit. If specified, the data element must be assigned to this data set. If not specified, a data set containing the data element will be chosen to check if the operation is allowed. | -
value | -No | -Data value. For boolean values, the following will be accepted: true | True | TRUE | false | False | FALSE | 1 | 0 | t | f | | -
comment | -No | -Data comment | -
followUp | -No | -Follow up on data value, will toggle the current boolean value | -
Period type | -Duration notation | -Example | -Duration | -
---|---|---|---|
Daily | -P1D | -2017-10-01/P1M | -Oct 01 2017 | -
Weekly | -P7D | -2017-10-01/P7D | -Oct 01 2017-Oct 07-2017 | -
Monthly | -P1M | -2017-10-01/P1M | -Oct 01 2017-Oct 31 2017 | -
Bi-monthly | -P2M | -2017-11-01/P2M | -Nov 01 2017-Dec 31 2017 | -
Quarterly | -P3M | -2017-09-01/P3M | -Sep 01 2017-Dec 31 2017 | -
Six-monthly | -P6M | -2017-01-01/P6M | -Jan 01 2017-Jun 30 2017 | -
Yearly | -P1Ý | -2017-01-01/P1Y | -Jan 01 2017-Dec 31 2017 | -
Financial October | -P1Y | -2017-10-01/P1Y | -Oct 01 2017-Sep 30 2018 | -
Financial April | -P1Y | -2017-04-01/P1Y | -April 1 2017-Mar 31 2018 | -
Financial July | -P1Y | -2017-07-01/P1Y | -July 1 2017-June 30 2018 | -
Value | -Description | -
---|---|
equal_to | -Equal to | -
not_equal_to | -Not equal to | -
greater_than | -Greater than | -
greater_than_or_equal_to | -Greater than or equal to | -
less_than | -Less than | -
less_than_or_equal_to | -Less than or equal to | -
compulsory_pair | -If either side is present, the other must also be | -
exclusive_pair | -If either side is present, the other must not be | -
Value | -Description | -
---|---|
SKIP_IF_ANY_VALUE_MISSING | -Skip validation rule if any data value is missing | -
SKIP_IF_ALL_VALUES_MISSING | -Skip validation rule if all data values are missing | -
NEVER_SKIP | -Never skip validation rule irrespective of missing data values | -
Query parameter | -Description | -Option | -
---|---|---|
vrg | -Validation rule group | -ID | -
ou | -Organisation unit | -ID | -
startDate | -Start date for the timespan | -Date | -
endDate | -End date for the timespan | -Date | -
persist | -Whether to persist violations in the system | -false | true | -
notification | -Whether to send notifications about violations | -false | true | -
Query parameter | -Description | -Option | -
---|---|---|
ou | -Organisation unit | -ID | -
startDate | -Start date for the timespan | -Date | -
endDate | -End date for the timespan | -Date | -
ds | -Data sets, parameter can be repeated | -ID | -
standardDeviation | -Number of standard deviations from the average | -Numeric value | -
Parameter | -Values | -Description | -
---|---|---|
dataSetIdScheme | -id | name | code | attribute:ID | -Property of the data set to use to map the complete registrations. | -
orgUnitIdScheme | -id | name | code | attribute:ID | -Property of the organisation unit to use to map the complete registrations. | -
attributeOptionComboIdScheme | -id | name | code | attribute:ID | -Property of the attribute option combos to use to map the complete registrations. | -
idScheme | -id | name | code | attribute:ID | -Property of all objects including data sets, org units and attribute option combos, to use to map the complete registrations. | -
preheatCache | -false | true | -Whether to save changes on the server or just return the import summary. | -
dryRun | -false | true | -Whether registration applies to sub units | -
importStrategy | -CREATE | UPDATE | CREATE_AND_UPDATE | DELETE | -Save objects of all, new or update import status on the server. | -
skipExistingCheck | -false | true | -Skip checks for existing complete registrations. Improves performance. Only use for empty databases or when the registrations to import do not exist already. | -
async | -false | true | -Indicates whether the import should be done asynchronous or synchronous. The former is suitable for very large imports as it ensures that the request does not time out, although it has a significant performance overhead. The latter is faster but requires the connection to persist until the process is finished. | -
Parameter | -Description | -
---|---|
dataSet | -Data set identifier, multiple data sets are allowed | -
period | -Period identifier in ISO format. Multiple periods are allowed. | -
startDate | -Start date for the time span of the values to export | -
endDate | -End date for the time span of the values to export | -
created | -Include only registrations which were created since the given timestamp | -
createdDuration | -Include only registrations which were created within the given duration. The format is <value><time-unit>, where the supported time units are "d", "h", "m", "s" (days, hours, minutes, seconds). The time unit is relative to the current time. | -
orgUnit | -Organisation unit identifier, can be specified multiple times. Not applicable if orgUnitGroup is given. | -
orgUnitGroup | -Organisation unit group identifier, can be specified multiple times. Not applicable if orgUnit is given. | -
children | -Whether to include the children in the hierarchy of the organisation units | -
limit | -The maximum number of registrations to include in the response. | -
idScheme | -Identifier property used for meta data objects in the response. | -
dataSetIdScheme | -Identifier property used for data sets in the response. Overrides idScheme. | -
orgUnitIdScheme | -Identifier property used for organisation units in the response. Overrides idScheme. | -
attributeOptionComboIdScheme | -Identifier property used for attribute option combos in the response. Overrides idScheme. | -
Query parameter | -Required | -Description | -
---|---|---|
ds | -Yes | -Data set identifier | -
pe | -Yes | -Period identifier | -
ou | -Yes | -Organisation unit identifier | -
cc | -No (must combine with cp) | -Attribute combo identifier (for locking check) | -
cp | -No (must combine with cp) | -Attribute option identifiers, separated with ; for multiple values (for locking check) | -
multiOu | -No (default false) | -Whether registration applies to sub units | -
Query parameter | -Required | -Description | -
---|---|---|
wf | -Yes | -Data approval workflow identifier | -
pe | -Yes | -Period identifier | -
ou | -Yes | -Organisation unit identifier | -
aoc | -No | -Attribute option combination identifier | -
Return Parameter | -Description | -
---|---|
mayApprove | -Whether the current user may approve this data selection. | -
mayUnapprove | -Whether the current user may unapprove this data selection. | -
mayAccept | -Whether the current user may accept this data selection. | -
mayUnaccept | -Whether the current user may unaccept this data selection. | -
state | -One of the data approval states from the table below. | -
State | -Description | -
---|---|
UNAPPROVABLE | -Data approval does not apply to this selection. (Data is neither approved nor unapproved.) | -
UNAPPROVED_WAITING | -Data could be approved for this selection, but is waiting for some lower-level approval before it is ready to be approved. | -
UNAPPROVED_ELSEWHERE | -Data is unapproved, and is waiting for approval somewhere else (not approvable here.) | -
UNAPPROVED_READY | -Data is unapproved, and is ready to be approved for this selection. | -
APPROVED_HERE | -Data is approved, and was approved here (so could be unapproved here.) | -
APPROVED_ELSEWHERE | -Data is approved, but was not approved here (so cannot be unapproved here.) This covers the following cases:
-
|
-
ACCEPTED_HERE | -Data is approved and accepted here (so could be unapproved here.) | -
ACCEPTED_ELSEWHERE | -Data is approved and accepted, but elsewhere. | -
Action parameter | -Required | -Description | -
---|---|---|
wf | -Yes | -Data approval workflow identifier | -
pe | -Yes | -Period identifier | -
ou | -Yes | -Organisation unit identifier | -
aoc | -No | -Attribute option combination identifier | -
Parameter | -Option | -Description | -
---|---|---|
ds | -Data Set | -One or more data set identifiers to get data elements from. | -
de | -Data Element | -One or more data element identifiers. | -
pe | -ISO Period | -One or more period ISO identifiers. | -
ou | -Organisation Unit | -One or more org unit identifiers. | -
auditType | -UPDATE | DELETE | -Filter by audit type. | -
skipPaging | -false | true | -Turn paging on / off | -
page | -1 (default) | -If paging is enabled, this parameter decides which page to show | -
Parameter | -Option | -Description | -
---|---|---|
de | -Data Element | -One or more data element identifiers. | -
ps | -Program Stage Entity | -One or more program stage instance identifiers. | -
auditType | -UPDATE | DELETE | -Filter by audit type. | -
skipPaging | -false | true | -Turn paging on / off | -
page | -1 (default) | -If paging is enabled, this parameter decides which page to show | -
Parameter | -Option | -Description | -
---|---|---|
tea | -Tracked Entity Attributes | -One or more tracked entity attribute identifiers. | -
te | -Tracked Entity Instances | -One or more tracked entity instance identifiers. | -
auditType | -UPDATE | DELETE | -Filter by audit type. | -
skipPaging | -false | true | -Turn paging on / off | -
page | -1 (default) | -If paging is enabled, this parameter decides which page to show | -
Parameter | -Option | -Description | -
---|---|---|
tei | -Tracked Entity Instance | -One or more tracked entity instance identifiers | -
user | -User | -One or more user identifiers | -
auditType | -SEARCH | READ | -Audit type to filter for | -
startDate | -Start date | -Start date for audit filtering in yyyy-mm-dd format. | -
endDate | -End date | -End date for audit filtering in yyyy-mm-dd format. | -
skipPaging | -false | true | -Turn paging on / off. | -
page | -1 (default) | -Specific page to ask for. | -
pageSize | -50 (default) | -Page size. | -
Parameter | -Option | -Description | -
---|---|---|
en | -Enrollment | -One or more tracked entity instance identifiers | -
user | -User | -One or more user identifiers | -
startDate | -Start date | -Start date for audit filtering in yyyy-mm-dd format. | -
endDate | -End date | -End date for audit filtering in yyyy-mm-dd format. | -
skipPaging | -false | true | -Turn paging on / off. | -
page | -1 (default) | -Specific page to ask for. | -
pageSize | -50 (default) | -Page size. | -
Parameter | -Option | -Description | -
---|---|---|
dal | -Data Approval Level | -One or more data approval level identifiers. | -
wf | -Workflow | -One or more data approval workflow identifiers. | -
ou | -Organisation Unit | -One or more organisation unit identifiers. | -
aoc | -Attribute Option Combo | -One or more attribute option combination identifiers. | -
startDate | -Start Date | -Starting Date for approvals in yyyy-mm-dd format. | -
endDate | -End Date | -Ending Date for approvals in yyyy-mm-dd format. | -
skipPaging | -false | true | -Turn paging on / off | -
page | -1 (default) | -If paging is enabled, this parameter decides which page to show. |
-
Status | -Priority | -
---|---|
OPEN | -LOW | -
PENDING | -MEDIUM | -
INVALID | -HIGH | -
SOLVED | -- |
Field | -Description | -
---|---|
id | -The interpretation identifier. | -
created | -The time of when the interpretation was created. | -
type | -The type of analytical object being interpreted. Valid options: REPORT_TABLE, CHART, MAP, EVENT_REPORT, EVENT_CHART, DATASET_REPORT. - |
user | -Association to the user who created the interpretation. | -
reportTable | -Association to the report table if type is REPORT_TABLE. | -
chart | -Association to the chart if type is CHART. | -
visualization | -Association to the visualization if type is CHART or REPORT_TABLE (**both types are in deprecation process in favour of VISUALIZATION**). | -
map | -Association to the map if type is MAP. | -
eventReport | -Association to the event report is type is EVENT_REPORT. | -
eventChart | -Association to the event chart if type is EVENT_CHART. | -
dataSet | -Association to the data set if type is DATASET_REPORT. | -
comments | -Array of comments for the interpretation. The text field holds the actual comment. | -
mentions | -Array of mentions for the interpretation. A list of users identifiers. | -
Resource | -Description | -Data URL | -Resource representations | -
---|---|---|---|
charts | -Charts | -/api/charts/<identifier>/data | -png | -
eventCharts | -Event charts | -/api/eventCharts/<identifier>/data | -png | -
maps | -Maps | -/api/maps/<identifier>/data | -png | -
reportTables | -Pivot tables | -/api/reportTables/<identifier>/data | -json | jsonp | html | xml | pdf | xls | csv | -
reports | -Standard reports | -/api/reports/<identifier>/data | -pdf | xls | html | -
documents | -Resources | -/api/documents/<identifier>/data | -<follows document> | -
Query parameter | -Value | -Description | -
---|---|---|
date | -Date in yyyy-MM-dd format | -Basis for relative periods in report (requires relative periods) | -
Query parameter | -Description | -
---|---|
width | -Width of image in pixels | -
height | -Height of image in pixels | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
url | -string | -Yes | -- | Base URL of the DHIS2 server | -
username | -string | -Yes (if cross-domain) | -- | Used for authentication if the server is running on a different domain | -
password | -string | -Yes (if cross-domain) | -- | Used for authentication if the server is running on a different domain | -
loadingIndicator | -boolean | -No | -- | Whether to show a loading indicator before the table appears | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
el | -string | -Yes | -- | Identifier of the HTML element to render the table in your web page | -
id | -string | -No | -- | Identifier of a pre-defined table (favorite) in DHIS2 | -
columns | -array | -Yes (if no id provided) | -- | Data dimensions to include in table as columns | -
rows | -array | -Yes (if no id provided) | -- | Data dimensions to include in table as rows | -
filter | -array | -No | -- | Data dimensions to include in table as filters | -
title | -string | -No | -- | Show a custom title above the table | -
showColTotals | -boolean | -No | -true | false | -Whether to display totals for columns | -
showRowTotals | -boolean | -No | -true | false | -Whether to display totals for rows | -
showColSubTotals | -boolean | -No | -true | false | -Whether to display sub-totals for columns | -
showRowSubTotals | -boolean | -No | -true | false | -Whether to display sub-totals for rows | -
showDimensionLabels | -boolean | -No | -true | false | -Whether to display the name of the dimension top-left in the table | -
hideEmptyRows | -boolean | -No | -false | true | -Whether to hide rows with no data | -
skipRounding | -boolean | -No | -false | true | -Whether to skip rounding of data values | -
completedOnly | -boolean | -No | -false | true | -Whether to only show completed events | -
showHierarchy | -boolean | -No | -false | true | -Whether to extend orgunit names with the name of all anchestors | -
aggregationType | -string | -No | -"SUM" |"AVERAGE" | "AVERAGE_SUM_ORG_UNIT"|"LAST"|"LAST_AVERAGE_ORG_UNIT"| "COUNT" | "STDDEV" | "VARIANCE" | "MIN" | "MAX" | -Override the data element's default aggregation type | -
displayDensity | -string | -No | -"NORMAL" | "COMFORTABLE" | "COMPACT" | -The amount of space inside table cells | -
fontSize | -string | -No | -"NORMAL" | "LARGE" | "SMALL" | -Table font size | -
digitGroupSeparator | -string | -No | -"SPACE" | "COMMA" | "NONE" | -How values are formatted: 1 000 | 1,000 | 1000 | -
legendSet | -object | -No | -- | Color the values in the table according to the legend set | -
userOrgUnit | -string / array | -No | -- | Organisation unit identifiers, overrides organisation units associated with curretn user, single or array | -
relativePeriodDate | -string | -No | -- | Date identifier e.g: "2016-01-01". Overrides the start date of the relative period | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
url | -string | -Yes | -- | Base URL of the DHIS2 server | -
username | -string | -Yes (if cross-domain) | -- | Used for authentication if the server is running on a different domain | -
password | -string | -Yes (if cross-domain) | -- | Used for authentication if the server is running on a different domain | -
loadingIndicator | -boolean | -No | -- | Whether to show a loading indicator before the chart appears | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
el | -string | -Yes | -- | Identifier of the HTML element to render the chart in your web page | -
id | -string | -No | -- | Identifier of a pre-defined chart (favorite) in DHIS | -
type | -string | -No | -column | stackedcolumn | bar | stackedbar | line | area | pie | radar | gauge | -Chart type | -
columns | -array | -Yes (if no id provided) | -- | Data dimensions to include in chart as series | -
rows | -array | -Yes (if no id provided) | -- | Data dimensions to include in chart as category | -
filter | -array | -No | -- | Data dimensions to include in chart as filters | -
title | -string | -No | -- | Show a custom title above the chart | -
showValues | -boolean | -No | -false | true | -Whether to display data values on the chart | -
hideEmptyRows | -boolean | -No | -false | true | -Whether to hide empty categories | -
completedOnly | -boolean | -No | -false | true | -Whether to only show completed events | -
regressionType | -string | -No | -"NONE" | "LINEAR" | -Show trend lines | -
targetLineValue | -number | -No | -- | Display a target line with this value | -
targetLineTitle | -string | -No | -- | Display a title on the target line (does not apply without a target line value) | -
baseLineValue | -number | -No | -- | Display a base line with this value | -
baseLineTitle | -string | -No | -- | Display a title on the base line (does not apply without a base line value) | -
rangeAxisTitle | -number | -No | -- | Title to be displayed along the range axis | -
rangeAxisMaxValue | -number | -No | -- | Max value for the range axis to display | -
rangeAxisMinValue | -number | -No | -- | Min value for the range axis to display | -
rangeAxisSteps | -number | -No | -- | Number of steps for the range axis to display | -
rangeAxisDecimals | -number | -No | -- | Bumber of decimals for the range axis to display | -
domainAxisTitle | -number | -No | -- | Title to be displayed along the domain axis | -
aggregationType | -string | -No | -"SUM" |"AVERAGE" | "AVERAGE_SUM_ORG_UNIT"|"LAST"|"LAST_AVERAGE_ORG_UNIT"| "COUNT" | "STDDEV" | "VARIANCE" | "MIN" | "MAX" | -Override the data element's default aggregation type | -
hideLegend | -boolean | -No | -false | true | -Whether to hide the series legend | -
hideTitle | -boolean | -No | -false | true | -Whether to hide the chart title | -
userOrgUnit | -string / array | -No | -- | Organisation unit identifiers, overrides organisation units associated with curretn user, single or array | -
relativePeriodDate | -string | -No | -- | Date identifier e.g: "2016-01-01". Overrides the start date of the relative period | -
Param | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
el | -string | -Yes | -- | Identifier of the HTML element to render the map in your web page | -
url | -string | -Yes | -- | Base URL of the DHIS2 server | -
id | -string | -No | -- | Identifier of a pre-defined map (favorite) in DHIS | -
baseLayer | -string/boolean | -No | -'gs', 'googlestreets' | 'gh', 'googlehybrid' | 'osm', 'openstreetmap' | false, null, 'none', 'off' | -Show background map | -
hideLegend | -boolean | -No | -false | true | -Hide legend panel | -
mapViews | -array | -Yes (if no id provided) | -- | Array of layers | -
layer | -string | -No | -"thematic1" | "thematic2" | "thematic3" | "thematic4" | "boundary" | "facility" | | -The layer to which the map view content should be added | -
columns | -array | -Yes | -- | Indicator, data element, data operand or data set (only one will be used) | -
rows | -array | -Yes | -- | Organisation units (multiple allowed) | -
filter | -array | -Yes | -- | Period (only one will be used) | -
classes | -integer | -No | -5 | 1-7 | -The number of automatic legend classes | -
method | -integer | -No | -2 | 3 | -Legend calculation method where 2 = equal intervals and 3 = equal counts | -
colorLow | -string | -No | -"ff0000" (red) | Any hex color | -The color representing the first automatic legend class | -
colorHigh | -string | -No | -"00ff00" (green) | Any hex color | -The color representing the last automatic legend class | -
radiusLow | -integer | -No | -5 | Any integer | -Only applies for facilities (points) - radius of the point with lowest value | -
radiusHigh | -integer | -No | -15 | Any integer | -Only applies for facilities (points) - radius of the point with highest value | -
opacity | -double | -No | -0.8 | 0 - 1 | -Opacity/transparency of the layer content | -
legendSet | -object | -No | -- | Pre-defined legend set. Will override the automatic legend set. | -
labels | -boolean/object | -No | -false | true | object properties: fontSize (integer), color (hex string), strong (boolean), italic (boolean) | -Show labels on the map | -
width | -integer | -No | -- | Width of map | -
height | -integer | -No | -- | Height of map | -
userOrgUnit | -string / array | -No | -- | Organisation unit identifiers, overrides organisation units associated with current user, single or array | -
Query parameter | -Description | -Type | -Default | -
---|---|---|---|
count | -The number of items of each type to return | -Positive integer | -6 | -
maxCount | -The number of items of max types to return | -Positive integer | -25 | -
max | -The type to return the maxCount for | -String [CHART|MAP|REPORT_TABLE|USER|REPORT|RESOURCE|VISUALIZATION] | -N/A | -
Query parameter | -Description | -Options | -
---|---|---|
type | -Type of the resource to be represented by the dashboard item | -chart | visualization | map | reportTable | users | reports | reportTables | resources | patientTabularReports | app | -
id | -Identifier of the resource to be represented by the dashboard item | -Resource identifier | -
Field | -Description | -
---|---|
id | -The unique identifier. | -
code | -A custom code to identify the Visualization. | -
name | -The name of the Visualization | -
type | -The type of the Visualization. The valid types are: COLUMN, STACKED_COLUMN, BAR, STACKED_BAR, LINE, AREA, PIE, RADAR, GAUGE, YEAR_OVER_YEAR_LINE YEAR_OVER_YEAR_COLUMN, SINGLE_VALUE, PIVOT_TABLE. | -
title | -A custom title. | -
subtitle | -A custom subtitle. | -
description | -Defines a custom description for the Visualization. | -
created | -The date/time of the Visualization creation. | -
startDate | -The beginning date used during the filtering. | -
endDate | -The ending date used during the filtering. | -
sortOrder | -The sorting order of this Visualization. Integer value. | -
user | -An object representing the creator of the Visualization. | -
publicAccess | -Sets the permissions for public access. | -
displayDensity | -The display density of the text. | -
fontSize | -The font size of the text. | -
fontStyle | -Custom font styles for: visualizationTitle, visualizationSubtitle, horizontalAxisTitle, verticalAxisTitle, targetLineLabel, baseLineLabel, seriesAxisLabel, categoryAxisLabel, legend. | -
relativePeriods | -An object representing the relative periods used in the analytics query. | -
legendSet | -An object representing the definitions for the legend. | -
legendDisplayStyle | -The legend's display style. It can be: FILL or TEXT. | -
legendDisplayStrategy | -The legend's display style. It can be: FIXED or BY_DATA_ITEM. | -
aggregationType | -Determines how the values in the pivot table are aggregated. Valid options: SUM, AVERAGE, AVERAGE_SUM_ORG_UNIT, LAST, LAST_AVERAGE_ORG_UNIT, FIRST, FIRST_AVERAGE_ORG_UNIT, COUNT, STDDEV, VARIANCE, MIN, MAX, NONE, CUSTOM or DEFAULT. | -
regressionType | -A valid regression type: NONE, LINEAR, POLYNOMIAL or LOESS. | -
targetLineValue | -The chart target line. Accepts a Double type. | -
targetLineLabel | -The chart target line label. | -
rangeAxisLabel | -The chart vertical axis (y) label/title. | -
domainAxisLabel | -The chart horizontal axis (x) label/title. | -
rangeAxisMaxValue | -The chart axis maximum value. Values outside of the range will not be displayed. | -
rangeAxisMinValue | -The chart axis minimum value. Values outside of the range will not be displayed. | -
rangeAxisSteps | -The number of axis steps between the minimum and maximum values. | -
rangeAxisDecimals | -The number of decimals for the axes values. | -
baseLineValue | -A chart baseline value. | -
baseLineLabel | -A chart baseline label. | -
digitGroupSeparator | -The digit group separator. Valid values: COMMA, SPACE or NONE. | -
topLimit | -The top limit set for the Pivot table. | -
measureCriteria | -Describes the criteria applied to this measure. | -
percentStackedValues | -Uses stacked values or not. More likely to be applied for graphics/charts. Boolean value. | -
noSpaceBetweenColumns | -Show/hide space between columns. Boolean value. | -
regression | -Indicates whether the Visualization contains regression columns. More likely to be applicable to Pivot/Report. Boolean value. | -
externalAccess | -Indicates whether the Visualization is available as external read-only. Boolean value. | -
userOrganisationUnit | -Indicates if the user has an organisation unit. Boolean value. | -
userOrganisationUnitChildren | -Indicates if the user has a children organisation unit. Boolean value. | -
userOrganisationUnitGrandChildren | -Indicates if the user has a grand children organisation unit . Boolean value. | -
reportingParams | -Object used to define boolean attributes related to reporting. | -
rowTotals | -Displays (or not) the row totals. Boolean value. | -
colTotals | -Displays (or not) the columns totals. Boolean value. | -
rowSubTotals | -Displays (or not) the row sub-totals. Boolean value. | -
colSubTotals | -Displays (or not) the columns sub-totals. Boolean value. | -
cumulativeValues | -Indicates whether the visualization is using cumulative values. Boolean value. | -
hideEmptyColumns | -Indicates whether to hide columns with no data values. Boolean value. | -
hideEmptyRows | -Indicates whether to hide rows with no data values. Boolean value. | -
completedOnly | -Indicates whether to hide columns with no data values. Boolean value. | -
skipRounding | -Apply or not rounding. Boolean value. | -
showDimensionLabels | -Shows the dimension labels or not. Boolean value. | -
hideTitle | -Hides the title or not. Boolean value. | -
hideSubtitle | -Hides the subtitle or not. Boolean value. | -
hideLegend | -Show/hide the legend. Very likely to be used by charts. Boolean value. | -
showHierarchy | -Displays (or not) the organisation unit hierarchy names. Boolean value. | -
showData | -Used by charts to hide or not data/values within the rendered model. Boolean value. | -
lastUpdatedBy | -Object that represents the user that applied the last changes to the Visualization. | -
lastUpdated | -The date/time of the last time the Visualization was changed. | -
favorites | -List of user ids who have marked this object as a favorite. | -
subscribers | -List of user ids who have subscribed to this Visualization. | -
translations | -Set of available object translation, normally filtered by locale. | -
Field | -Description | -
---|---|
id | -The unique identifier. | -
code | -A custom code to identify the dimensional item. | -
created | -The date of creation. | -
lastUpdated | -The last date when this item was updated. | -
name | -The name given for the item. | -
shortName | -A short name given for the item. | -
displayName | -The display name defined. | -
displayShortName | -The display short name set. | -
displayFormName | -The name of the associated form. | -
dimensionItem | -The unique identifier, same as id. | -
dimensionItemType | -The dimension type. Possible types: INDICATOR, DATA_ELEMENT, REPORTING_RATE, PROGRAM_INDICATOR, PROGRAM_DATA_ELEMENT, PROGRAM_ATTRIBUTE. | -
aggregationType | -The aggregation type defined for this dimensional item. They can be: SUM, AVERAGE, AVERAGE_SUM_ORG_UNIT, LAST, -LAST_AVERAGE_ORG_UNIT, FIRST, FIRST_AVERAGE_ORG_UNIT, COUNT, STDDEV, VARIANCE, MIN, MAX, NONE, CUSTOM, DEFAULT. | -
publicAccess | -The permissions set for public access. | -
externalAccess | -Indicates whether the item is available externaly as read-only. Boolean value. | -
favorites | -List of user ids who have marked this object as a favorite. | -
favorite | -Indicates if the current istem is set as favorite for the current user. Boolean value. | -
access | -Access information for this item, related to the current user. | -
user | -The owner of this object. | -
translations | -Set of translatable objects available. Normally filtered by locale. | -
userGroupAccesses | -Groups access to the current dimensional item. | -
attributeValues | -Set of the dynamic attributes values that belong to the current item. | -
userAccesses | -List of user accesses related to this object. | -
legendSet | -Defines the legend set values. Will override the automatic legend set. | -
Query parameter | -Required | -Description | -Options (default first) | -
---|---|---|---|
dimension | -Yes | -Dimensions and dimension items to be retrieved, repeated for each. | -Any dimension | -
filter | -No | -Filters and filter items to apply to the query, repeated for each. | -Any dimension | -
aggregationType | -No | -Aggregation type to use in the aggregation process. | -SUM | AVERAGE | AVERAGE_SUM_ORG_UNIT | LAST | LAST_AVERAGE_ORG_UNIT | COUNT | STDDEV | VARIANCE | MIN | MAX | -
measureCriteria | -No | -Filters for the data/measures. | -EQ | GT | GE | LT | LE | -
preAggregationMeasureCriteria | -No | -Filters for the data/measure, applied before aggregation is performed. | -EQ | GT | GE | LT | LE | -
startDate | -No | -Start date for a date range. Will be applied as a filter. Can not be used together with a period dimension or filter. | -Date | -
endDate | -No | -End date for date range. Will be applied as a filter. Can not be used together with a period dimension or filter. | -Date | -
skipMeta | -No | -Exclude the metadata part of the response (improves performance). | -false | true | -
skipData | -No | -Exclude the data part of the response. | -false | true | -
skipRounding | -No | -Skip rounding of data values, i.e. provide full precision. | -false | true | -
hierarchyMeta | -No | -Include names of organisation unit ancestors and hierarchy paths of organisation units in the metadata. | -false | true | -
ignoreLimit | -No | -Ignore limit on max 50 000 records in response - use with care. | -false | true | -
tableLayout | -No | -Use plain data source or table layout for the response. | -false | true | -
hideEmptyRows | -No | -Hides empty rows in response, applicable when table layout is true. | -false | true | -
hideEmptyColumns | -No | -Hides empty columns in response, applicable when table layout is true. | -false | true | -
showHierarchy | -No | -Display full org unit hierarchy path together with org unit name. | -false | true | -
includeNumDen | -No | -Include the numerator and denominator used to calculate the value in the response. | -false | true | -
includeMetadataDetails | -No | -Include metadata details to raw data response. | -false | true | -
displayProperty | -No | -Property to display for metadata. | -NAME | SHORTNAME | -
outputIdScheme | -No | -Identifier scheme to use for metadata items the query response, can be identifier, code or attributes. | -UID | CODE |NAME| ATTRIBUTE:<ID> | -
inputIdScheme | -No | -Identifier scheme to use for metadata items in the query request, can be an identifier, code or attributes. | -UID | CODE | ATTRIBUTE:<ID> | -
approvalLevel | -No | -Include data which has been approved at least up to the given approval level, refers to identifier of approval level. | -Identifier of approval level | -
relativePeriodDate | -No | -Date used as basis for relative periods. | -Date. | -
userOrgUnit | -No | -Explicitly define the user org units to utilize, overrides organisation units associated with the current user, multiple identifiers can be separated by semicolon. | -Organisation unit identifiers. | -
columns | -No | -Dimensions to use as columns for table layout. | -Any dimension (must be query dimension) | -
rows | -No | -Dimensions to use as rows for table layout. | -Any dimension (must be query dimension) | -
order | -No | -Specify the ordering of rows based on value. | -ASC | DESC | -
timeField | -No | -The time field to base event aggregation on. Applies to event data items only. Can be a predefined option or the ID of an attribute or data element with a time-based value type. | -EVENT_DATE | ENROLLMENT_DATE | INCIDENT_DATE | DUE_DATE | COMPLETED_DATE | CREATED | LAST_UPDATED | <Attribute ID> | <Data element ID> | -
orgUnitField | -No | -The organisation unit field to base event aggregation on. Applies to event data items only. Can be the ID of an attribute or data element with the Organisation unit value type. The default option is specified as omitting the query parameter. - | <Attribute ID> | <Data element ID> | -
Dimension | -Dimension id | -Dimension items | -
---|---|---|
Data elements, indicators, data set reporting rate metrics, data element operands, program indicators, program data elements, program attributes, validation rules | -dx | -Data element, indicator, data set reporting rate metrics, data element operand, program indicator, program attribute identifiers, keyword DE_GROUP-<group-id>, IN_GROUP-<group-id>, use <dataelement-id>.<optioncombo-id> for data element operands, <program-id>.<dataelement-id> for program data elements, <program-id>.<attribute-id> for program attributes, <validationrule-id> for validation results. | -
Periods (time) | -pe | -ISO periods and relative periods, see "date and period format" | -
Organisation unit hierarchy | -ou | -Organisation unit identifiers, and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | -
Category option combinations | -co | -Category option combo identifiers (omit to get all items) | -
Attribute option combinations | -ao | -Category option combo identifiers (omit to get all items) | -
Categories | -<category id> | -Category option identifiers (omit to get all items) | -
Data element group sets | -<group set id> | -Data element group identifiers (omit to get all items) | -
Organisation unit group sets | -<group set id> | -Organisation unit group identifiers (omit to get all items) | -
Category option group sets | -<group set id> | -Category option group identifiers (omit to get all items) | -
Type | -Syntax | -Description | -Data source | -
---|---|---|---|
Indicator | -<indicator-id> | -Indicator identifier. | -Aggregated data | -
Indicator grop | -IN_GROUP-<indicatorgroup-id> | -Keyword followed by an indicator group identifier. Will include all indicators in the group in the response. | -Aggregated data | -
Data element | -<dataelement-id> | -Data element identifier. | -Aggregated data | -
Data element group | -DE_GROUP-<dataelementgroup-id> | -Keyword followed by a data element group identifier. Will include all data elements in the group in the response. | -Aggregated data | -
Data element operand | -<dataelement-id>.<categoryoptcombo-id>.<attributeoptcombo-id> | -Data element identifier followed by one or both of category option combination and attribute option combo identifier. Wildcard "*" symbol can be used to indicate any option combination value. The attribute option combination identifier can be completely left out. | -Aggregate data | -
Data set | -<dataset-id>.<reporting-rate-metric> | -Data set identifier followed by reporting rate metric. Can be REPORTING_RATE | REPORTING_RATE_ON_TIME | ACTUAL_REPORTS | ACTUAL_REPORTS_ON_TIME | EXPECTED_REPORTS. | -Data set completeness registrations | -
Program data element | -<program-id>.<dataelement-id> | -Program identifier followed by data element identifier. Reads from events within the specified program. | -Events from the given program | -
Program indicator | -<programindicator-id> | -Program indicator identifier. Reads from events from within the program associated with the program identifier. | -Events from the program of the program indicator | -
Validation result | -<validationrule-id> | -Validation rule identifier. Will include validation rule violations for the validation rule, requires that validation results are generated and persisted. | -Validation results | -
Query parameter | -Required / Notes | -
---|---|
dimension | -Yes | -
startDate | -No / yyyy-MM-dd | -
endDate | -No / yyyy-MM-dd | -
skipMeta | -No | -
skipData | -No | -
hierarchyMeta | -No | -
showHierarchy | -No | -
displayProperty | -No | -
outputIdScheme | -No | -
inputIdScheme | -No | -
userOrgUnit | -No | -
Dimension | -Dimension id | -Description | -
---|---|---|
Data elements | -<id> | -Data element identifiers | -
Attributes | -<id> | -Attribute identifiers | -
Periods | -pe | -ISO periods and relative periods, see "date and period format" | -
Organisation units | -ou | -Organisation unit identifiers and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | -
Organisation unit group sets | -<org unit group set id> | -Organisation unit group set identifiers | -
Categories | -<category id> | -Category identifiers (program attribute categories only) | -
Query parameter | -Required | -Description | -Options (default first) | -
---|---|---|---|
program | -Yes | -Program identifier. | -Any program identifier | -
stage | -No | -Program stage identifier. | -Any program stage identifier | -
startDate | -Yes | -Start date for events. | -Date in yyyy-MM-dd format | -
endDate | -Yes | -End date for events. | -Date in yyyy-MM-dd format | -
dimension | -Yes | -Dimension identifier including data elements, attributes, program indicators, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | -Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN | -
filter | -No | -Dimension identifier including data elements, attributes, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | -- |
hierarchyMeta | -No | -Include names of organisation unit ancestors and hierarchy paths of organisation units in the metadata. | -false | true | -
eventStatus | -No | -Specify status of events to include. | -ACTIVE | COMPLETED | SCHEDULE | OVERDUE | SKIPPED | -
programStatus | -No | -Specify enrollment status of events to include. | -ACTIVE | COMPLETED | CANCELLED | -
relativePeriodDate | -string | -No | -Date identifier e.g: "2016-01-01". Overrides the start date of the relative period | -
columns | -No | -Dimensions to use as columns for table layout. | -Any dimension (must be query dimension) | -
rows | -No | -Dimensions to use as rows for table layout. | -Any dimension (must be query dimension) | -
Query parameter | -Required | -Description | -Options | -
---|---|---|---|
ouMode | -No | -The mode of selecting organisation units. Default is DESCENDANTS, meaning all sub units in the hierarchy. CHILDREN refers to immediate children in the hierarchy; SELECTED refers to the selected organisation units only. | -DESCENDANTS, CHILDREN, SELECTED | -
asc | -No | -Dimensions to be sorted ascending, can reference event date, org unit name and code and any item identifiers. | -EVENTDATE | OUNAME | OUCODE | item identifier | -
desc | -No | -Dimensions to be sorted descending, can reference event date, org unit name and code and any item identifiers. | -EVENTDATE | OUNAME | OUCODE | item identifier | -
coordinatesOnly | -No | -Whether to only return events which have coordinates. | -false | true | -
dataIdScheme | -No | -Id scheme to be used for data, more specifically data elements and attributes which have an option set or legend set, e.g. return the name of the option instead of the code, or the name of the legend instead of the legend ID, in the data response. | -NAME | CODE | UID | -
page | -No | -The page number. Default page is 1. | -Numeric positive value | -
pageSize | -No | -The page size. Default size is 50 items per page. | -Numeric zero or positive value | -
Query parameter | -Required | -Description | -Options | -
---|---|---|---|
value | -No | -Value dimension identifier. Can be a data element or an attribute which must be of numeric value type. | -Data element or attribute identifier | -
aggregationType | -No | -Aggregation type for the value dimension. Default is AVERAGE. | -SUM | AVERAGE | AVERAGE_SUM_ORG_UNIT | LAST | LAST_AVERAGE_ORG_UNIT | COUNT | STDDEV | VARIANCE | MIN | MAX | -
showHierarchy | -No | -Display full org unit hierarchy path together with org unit name. | -false | true | -
displayProperty | -No | -Property to display for metadata. | -NAME | SHORTNAME | -
sortOrder | -No | -Sort the records on the value column in ascending or descending order. | -ASC | DESC | -
limit | -No | -The maximum number of records to return. Cannot be larger than 10 000. | -Numeric positive value | -
outputType | -No | -Specify output type for analytical data which can be events, enrollments or tracked entity instances. The two last options apply to programs with registration only. | -EVENT | ENROLLMENT | TRACKED_ENTITY_INSTANCE | -
collapseDataDimensions | -No | -Collapse all data dimensions (data elements and attributes) into a single dimension in the response. | -false | true | -
skipMeta | -No | -Exclude the meta data part of the response (improves performance). | -false | true | -
skipData | -No | -Exclude the data part of the response. | -false | true | -
skipRounding | -No | -Skip rounding of aggregate data values. | -false | true | -
aggregateData | -No | -Produce aggregate values for the data dimensions (as opposed to dimension items). | -false | true | -
timeField | -No | -The time field to base event aggregation on. Applies to event data items only. Can be a predefined option or the ID of an attribute or data element having a time-based value type. | -EVENT_DATE | ENROLLMENT_DATE | INCIDENT_DATE | DUE_DATE | COMPLETED_DATE | <Attribute ID> | <Data element ID> | -
orgUnitField | -No | -The organisation unit field to base event aggregation on. Applies to event data items only. Can be the ID of an attribute or data element with the Organisation unit value type. The default option is specified as omitting the query parameter. - | <Attribute ID> | <Data element ID> | -
Query parameter | -Required | -Description | -Options | -
---|---|---|---|
clusterSize | -Yes | -Size of clusters in meters. | -Numeric positive value | -
coordinateField | -No | -Field to base geospatial event analytics on. Default is event. Can be set to identifiers of attributes and data elements of value type coordinate. | -EVENT | <attribute-id> | <dataelement-id> | -
bbox | -Yes | -Bounding box / area of events to include in the response on the format "min longitude, min latitude, max longitude , max latitude". | -String | -
includeClusterPoints | -No | -Include information about underlying points for each cluster, be careful if cluster represent a very high number of points. | -false | true | -
Operator | -Description | -
---|---|
EQ | -Equal to | -
GT | -Greater than | -
GE | -Greater than or equal to | -
LT | -Less than | -
LE | -Less than or equal to | -
NE | -Not equal to | -
LIKE | -Like (free text match) | -
IN | -Equal to one of multiple values separated by ";" | -
Dimension | -Dimension id | -Description | -
---|---|---|
Data elements in program stages | -<program stage id>.<data element id> | -Data element identifiers must include the program stage when querying data for enrollments. - - dimension=edqlbukwRfQ.vANAXwtLwcT - - | -
Attributes | -<id> | -Attribute identifiers | -
Periods | -pe | -ISO periods and relative periods, see "date and period format" | -
Organisation units | -ou | -Organisation unit identifiers and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | -
Operator | -Description | -
---|---|
EQ | -Equal to | -
GT | -Greater than | -
GE | -Greater than or equal to | -
LT | -Less than | -
LE | -Less than or equal to | -
NE | -Not equal to | -
LIKE | -Like (free text match) | -
IN | -Equal to one of multiple values separated by ";" | -
Query parameter | -Required | -Description | -Options (default first) | -
---|---|---|---|
program | -Yes | -Program identifier. | -Any program identifier | -
startDate | -No | -Start date for enrollments. | -Date in yyyy-MM-dd format | -
endDate | -No | -End date for enrollments. | -Date in yyyy-MM-dd format | -
dimension | -Yes | -Dimension identifier including data elements, attributes, program indicators, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | -Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN | -
filter | -No | -Dimension identifier including data elements, attributes, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | -- |
programStatus | -No | -Specify enrollment status of enrollments to include. | -ACTIVE | COMPLETED | CANCELLED | -
relativePeriodDate | -string | -No | -Date identifier e.g: "2016-01-01". Overrides the start date of the relative period | -
ouMode | -No | -The mode of selecting organisation units. Default is DESCENDANTS, meaning all sub units in the hierarchy. CHILDREN refers to immediate children in the hierarchy; SELECTED refers to the selected organisation units only. | -DESCENDANTS, CHILDREN, SELECTED | -
asc | -No | -Dimensions to be sorted ascending, can reference enrollment date, incident date, org unit name and code. | -ENROLLMENTDATE | INCIDENTDATE| OUNAME | OUCODE | -
desc | -No | -Dimensions to be sorted descending, can reference enrollment date, incident date, org unit name and code. | -ENROLLMENTDATE | INCIDENTDATE| OUNAME | OUCODE | -hierarchyMeta | -No | -Include names of organisation unit ancestors and hierarchy paths of organisation units in the metadata. | -false | true | - -
coordinatesOnly | -No | -Whether to only return enrollments which have coordinates. | -false | true | -
page | -No | -The page number. Default page is 1. | -Numeric positive value | -
pageSize | -No | -The page size. Default size is 50 items per page. | -Numeric zero or positive value | -
Property | -Description | -Required | -
---|---|---|
ou | -Org unit identifiers, potentially separated by a semicolon. | -Yes | -
ougs | -Org unit group set identifiers, potentially separated by a semicolon. | -Yes | -
columns | -Org unit group set identifiers, potentially separated by a semicolon. Defines which group sets are rendered as columns in a table layout. | -No | -
Parameter | -Description | -Type | -Required | -
---|---|---|---|
ds | -Data set to create the report from. | -Data set UID | -Yes | -
pe | -Period to create the report from. | -ISO String | -Yes | -
ou | -Organisation unit to create the report from. | -Organisation unit UID | -Yes | -
filter | -Filters to be used as filters for the report. Can be repeated any number of times. Follows the analytics API syntax. | -One or more UIDs | -No | -
selectedUnitOnly | -Whether to use captured data only or aggregated data. | -Boolean | -No | -
Property | -Description | -Type | -Required | -
---|---|---|---|
dashboard | -Dashboard on which reports are based | -Dashboard UID | -Yes | -
message | -Appears after title in reports | -String | -No | -
recipientUserGroups | -A set of user groups who should receive the reports | -One or more user Group UID | -No. Scheduled jobs without any recipient will be skipped. | -
enabled | -Indicated whether this push analysis should be scheduled or not. False by default. | -Boolean | -Yes. Must be true to be scheduled. | -
schedulingFrequency | -The frequency of which reports should be scheduled. | -"DAILY", "WEEKLY", "MONTHLY" | -No. Push analysis without a frequency will not be scheduled | -
schedulingDayOfFrequency | -The day in the frequency the job should be scheduled. | -Integer. Any value when frequency is "DAILY". 0-7 when frequency is "WEEKLY". 1-31 when frequency is "MONTHLY" | -No. Push analysis without a valid day of frequency for the frequency set will not be scheduled. | -
Key | -Description | -
---|---|
REPORT_TABLE_VIEW | -Report table (pivot table) view | -
CHART_VIEW | -Chart view | -
MAP_VIEW | -Map view (GIS) | -
EVENT_REPORT_VIEW | -Event report view | -
EVENT_CHART_VIEW | -Event chart view | -
DASHBOARD_VIEW | -Dashboard view | -
DATA_SET_REPORT_VIEW | -Data set report view | -
Query parameter | -Required | -Description | -Options | -
---|---|---|---|
startDate | -Yes | -Start date for period | -Date in yyyy-MM-dd format | -
endDate | -Yes | -End date for period | -Date in yyyy-MM-dd format | -
interval | -Yes | -Type of interval to be aggregated | -DAY, WEEK, MONTH, YEAR | -
Query parameter | -Required | -Description | -Options | -
---|---|---|---|
eventType | -Yes | -The data statistics event type | -See above table | -
pageSize | -No | -Size of the list returned | -For example 5, 10, 25. Default is 25 | -
sortOrder | -No | -Descending or ascending | -ASC or DESC. Default is DESC. | -
username | -No | -If specified, the response will only contain favorites by this user. | -For example 'admin' | -
Property | -Description | -
---|---|
id | -Organisation unit / geo feature identifier | -
na | -Organisation unit / geo feature name | -
hcd | -Has coordinates down, indicating whether one or more children organisation units exist with coordinates (below in the hierarchy) | -
hcu | -Has coordinates up, indicating whether the parent organisation unit has coordinates (above in the hierarchy) | -
le | -Level of this organisation unit / geo feature. | -
pg | -Parent graph, the graph of parent organisation unit identifiers up to the root in the hierarchy | -
pi | -Parent identifier, the identifier of the parent of this organisation unit | -
pn | -Parent name, the name of the parent of this organisation unit | -
ty | -Geo feature type, 1 = point and 2 = polygon or multi-polygon | -
co | -Coordinates of this geo feature | -
Query parameter | -Options | -Description | -
---|---|---|
skipResourceTables | -false | true | -Skip generation of resource tables | -
skipAggregate | -false | true | -Skip generation of aggregate data and completeness data | -
skipEvents | -false | true | -Skip generation of event data | -
skipEnrollment | -false | true | -Skip generation of enrollment data | -
lastYears | -integer | -Number of last years of data to include | -
HTTP Status code | -Description | -Outcome | -
---|---|---|
200 | -OK | -Authentication was successful | -
302 | -Found | -No credentials were supplied with the request - no authentication took place | -
401 | -Unauthorized | -The username and password combination was incorrect - authentication failed | -
Identifier | -Description | -
---|---|
ANALYTICS_TABLE | -Generation of the analytics tables. | -
RESOURCE_TABLE | -Generation of the resource tables. | -
MONITORING | -Processing of data surveillance/monitoring validation rules. | -
DATAVALUE_IMPORT | -Import of data values. | -
EVENT_IMPORT | -Import of events. | -
ENROLLMENT_IMPORT | -Import of enrollments. | -
TEI_IMPORT | -Import of tracked entity instances. | -
METADATA_IMPORT | -Import of metadata. | -
DATA_INTEGRITY | -Processing of data integrity checks. | -
Property name | -Description | -
---|---|
name | -Object name | -
shortName | -Object short name | -
description | -Object description | -
Class name | -Description | -
---|---|
DataElementCategoryOption | -Category option | -
DataElementCategory | -Category | -
DataElementCategoryCombo | -Category combination | -
DataElement | -Data element | -
DataElementGroup | -Data element group | -
DataElementGroupSet | -Data element group set | -
Indicator | -Indicator | -
IndicatorType | -Indicator type | -
IndicatorGroup | -Indicator group | -
IndicatorGroupSet | -Indicator group set | -
OrganisationUnit | -Organisation unit | -
OrganisationUnitGroup | -Organisation unit group | -
OrganisationUnitGroupSet | -Organisation unit group set | -
DataSet | -Data set | -
Section | -Data set section | -
ValidationRule | -Validation rule | -
ValidationRuleGroup | -Validation rule group | -
Program | -Program | -
ProgramStage | -Program stage | -
TrackedEntityAttribute | -Tracked entity attribute | -
TrackedEntity | -Tracked entity | -
RelationshipType | -Relationship type for tracked entity instances | -
OptionSet | -Option set | -
Attribute | -Attribute for metadata | -
Response code | -Response Message | -Detail Description | -
---|---|---|
RESULT_CODE_0 | -success | -Message has been sent successfully | -
RESULT_CODE_1 | -scheduled | -Message has been scheduled successfully | -
RESULT_CODE_22 | -internal fatal error | -Internal fatal error | -
RESULT_CODE_23 | -authentication failure | -Authentication credentials are incorrect | -
RESULT_CODE_24 | -data validation failed | -Parameters provided in request are incorrect | -
RESULT_CODE_25 | -insufficient credits | -Credit is not enough to send message | -
RESULT_CODE_26 | -upstream credits not available | -Upstream credits not available | -
RESULT_CODE_27 | -exceeded your daily quota | -You have exceeded your daily quota | -
RESULT_CODE_40 | -temporarily unavailable | -Service is temporarily down | -
RESULT_CODE_201 | -maximum batch size exceeded | -Maximum batch size exceeded | -
RESULT_CODE_200 | -success | -The request was successfully completed | -
RESULT_CODE_202 | -accepted | -The message(s) will be processed | -
RESULT_CODE_207 | -multi-status | -More than one message was submitted to the API; however, not all messages have the same status | -
RESULT_CODE_400 | -bad request | -Validation failure (such as missing/invalid parameters or headers) | -
RESULT_CODE_401 | -unauthorized | -Authentication failure. This can also be caused by IP lockdown settings | -
RESULT_CODE_402 | -payment required | -Not enough credit to send message | -
RESULT_CODE_404 | -not found | -Resource does not exist | -
RESULT_CODE_405 | -method not allowed | -Http method is not support on the resource | -
RESULT_CODE_410 | -gone | -Mobile number is blocked | -
RESULT_CODE_429 | -too many requests | -Generic rate limiting error | -
RESULT_CODE_503 | -service unavailable | -A temporary error has occurred on our platform - please retry | -
Parameter | -Type | -Description | -
---|---|---|
message | -String | -This is mandatory parameter which carries the actual text message. | -
originator | -String | -This is mandatory parameter which shows by whom this message was actually sent from. | -
gateway | -String | -This is an optional parameter which gives gateway id. If not present default text "UNKNOWN" will be stored | -
receiveTime | -Date | -This is an optional parameter. It is timestamp at which message was received at the gateway. | -
Parameter | -Type | -Description | -
---|---|---|
name | -String | -name of the gateway | -
configurationTemplate | -String | -Configuration template which get populated with parameter values. For example configuration template given above will be populated like this { "to": "+27001234567", "body": "Hello World!"} | -
useGet | -Boolean | -Http POST nethod will be used by default. In order to change it and Http GET, user can set useGet flag to true. | -
contentType | -String | -Content type specify what type of data is being sent. Supported types are APPLICATION_JSON, APPLICATION_XML, FORM_URL_ENCODED, TEXT_PLAIN | -
urlTemplate | -String | -Url template | -
header | -Boolean | -If parameter needs to be sent in Http headers | -
encode | -Boolean | -If parameter needs to be encoded | -
key | -String | -parameter key | -
value | -String | -parameter value | -
confidential | -Boolean | -If parameter is confidential. This parameter will not be exposed through API | -
sendUrlParameters | -Boolean | -If this flag is checked then urlTemplate can be appended with query parameters. This is usefull if gateway API only support HTTP GET. Sample urlTemplate looks like this "urlTemplate":"https://samplegateway.com/messages?apiKey={apiKey}&to={recipients},content={text},deliveryreport={dp}" | -
Field | -Required | -Description | -Values | -
---|---|---|---|
recipients | -Yes | -Recipients of the program message. At least one recipient must be specified. Any number of recipients / types can be specified for a message. | -Can be trackedEntityInstance, organisationUnit, an array of phoneNumbers or an array of emailAddresses. | -
programInstance | -Either this or programStageInstance required | -The program instance / enrollment. | -Enrollment ID. | -
programStageInstance | -Either this or programInstance required | -The program stage instance / event. | -Event ID. | -
deliveryChannels | -Yes | -Array of delivery channels. | -SMS | EMAIL | -
subject | -No | -The message subject. Not applicable for SMS delivery channel. | -Text. | -
text | -Yes | -The message text. | -Text. | -
storeCopy | -No | -Whether to store a copy of the program message in DHIS2. | -false (default) | true | -
Parameter | -URL | -
---|---|
programInstance | -/api/33/messages?programInstance=6yWDMa0LP7 | -
programStageInstance | -/api/33/messages?programStageInstance=SllsjpfLH2 | -
trackedEntityInstance | -/api/33/messages?trackedEntityInstance=xdfejpfLH2 | -
organisationUnit | -/api/33/messages?ou=Sllsjdhoe3 | -
processedDate | -/api/33/messages?processedDate=2016-02-01 | -
Parameter | -Type | -Description | -
---|---|---|
query | -Text | -Query value for first name, surname, username and email, case in-sensitive. | -
phoneNumber | -Text | -Query for phone number. | -
canManage | -false | true | -Filter on whether the current user can manage the returned users through the managed user group relationships. | -
authSubset | -false | true | -Filter on whether the returned users have a subset of the authorities of the current user. | -
lastLogin | -Date | -Filter on users who have logged in later than the given date. | -
inactiveMonths | -Number | -Filter on users who have not logged in for the given number of months. | -
inactiveSince | -Date | -Filter on users who have not logged in later than the given date. | -
selfRegistered | -false | true | -Filter on users who have self-registered their user account. | -
invitationStatus | -none | all | expired | -Filter on user invitations, including all or expired invitations. | -
ou | -Identifier | -Filter on users who are associated with the organisation unit with the given identifier. | -
userOrgUnits | -false | true | -Filter on users who are associated with the organisation units linked to the currently logged in user. | -
includeChildren | -false | true | -Includes users from all children organisation units of the ou parameter. | -
page | -Number | -The page number. | -
pageSize | -Number | -The page size. | -
Key | -Description | -Translatable | -
---|---|---|
keyUiLocale | -Locale for the user interface | -No | -
keyDbLocale | -Locale for the database | -No | -
keyAnalysisDisplayProperty | -The property to display in analysis. Default: "name" | -No | -
keyAnalysisDigitGroupSeparator | -The separator used to separate digit groups | -No | -
keyCurrentDomainType | -Not yet in use | -No | -
keyTrackerDashboardLayout | -Used by tracker capture | -No | -
applicationTitle | -The application title. Default: "DHIS2" | -Yes | -
keyApplicationIntro | -The application introduction | -Yes | -
keyApplicationNotification | -Application notification | -Yes | -
keyApplicationFooter | -Application left footer | -Yes | -
keyApplicationRightFooter | -Application right footer | -Yes | -
keyFlag | -Application flag | -No | -
keyFlagImage | -Flag used in dashboard menu | -No | -
startModule | -The startpage of the application. Default: "dhis-web-dashboard-integration" | -No | -
factorDeviation | -Data analysis standard deviation factor. Default: "2d" | -No | -
keyEmailHostName | -Email server hostname | -No | -
keyEmailPort | -Email server port | -No | -
keyEmailTls | -Use TLS. Default: "true" | -No | -
keyEmailSender | -Email sender | -No | -
keyEmailUsername | -Email server username | -No | -
keyEmailPassword | -Email server password | -No | -
minPasswordLength | -Minimum length of password | -No | -
maxPasswordLength | -Maximum length of password | -No | -
keySmsSetting | -SMS configuration | -No | -
keyCacheStrategy | -Cache strategy. Default: "CACHE_6AM_TOMORROW" | -No | -
keyCacheability | -PUBLIC or PRIVATE. Determines if proxy servers are allowed to cache data or not. | -No | -
phoneNumberAreaCode | -Phonenumber area code | -No | -
multiOrganisationUnitForms | -Enable multi-organisation unit forms. Default: "false" | -No | -
keyConfig | -- | No | -
keyAccountRecovery | -Enable user account recovery. Default: "false" | -No | -
keyLockMultipleFailedLogins | -Enable locking access after multiple failed logins | -No | -
googleAnalyticsUA | -Google Analytic UA key for tracking site-usage | -No | -
credentialsExpires | -Require user account password change. Default: "0" (Never) | -No | -
credentialsExpiryAlert | -Enable alert when credentials are close to expiration date | -No | -
keySelfRegistrationNoRecaptcha | -Do not require recaptcha for self registration. Default: "false" | -No | -
recaptchaSecret | -Google API recaptcha secret. Default: dhis2 play instance API secret, but this will only works on you local instance and not in production. | -No | -
recaptchaSite | -Google API recaptcha site. Default: dhis2 play instance API site, but this will only works on you local instance and not in production. | -No | -
keyCanGrantOwnUserAuthorityGroups | -Allow users to grant own user roles. Default: "false" | -No | -
keySqlViewMaxLimit | -Max limit for SQL view | -No | -
keyRespectMetaDataStartEndDatesInAnalyticsTableExport | -When "true", analytics will skip data not within category option's start and end dates. Default: "false" | -No | -
keySkipDataTypeValidationInAnalyticsTableExport | -Skips data type validation in analytics table export | -No | -
keyCustomLoginPageLogo | -Logo for custom login page | -No | -
keyCustomTopMenuLogo | -Logo for custom top menu | -No | -
keyCacheAnalyticsDataYearThreshold | -Analytics data older than this value (in years) will always be cached. "0" disabled this setting. Default: 0 | -No | -
keyCacheAnalyticsDataYearThreshold | -Analytics data older than this value (in years) will always be cached. "0" disabled this setting. Default: 0 | -No | -
analyticsFinancialYearStart | -Set financial year start. Default: October | -No | -
keyIgnoreAnalyticsApprovalYearThreshold | -"0" check approval for all data. "-1" disable approval checking. "1" or higher checks approval for all data that is newer than "1" year. | -No | -
keyAnalyticsMaxLimit | -Maximum number of analytics recors. Default: "50000" | -No | -
keyAnalyticsMaintenanceMode | -Put analytics in maintenance mode. Default: "false" | -No | -
keyDatabaseServerCpus | -Number of database server CPUs. Default: "0" (Automatic) | -No | -
keyLastSuccessfulAnalyticsTablesRuntime | -Keeps timestamp of last successful analytics tables run | -No | -
keyLastSuccessfulLatestAnalyticsPartitionRuntime | -Keeps timestamp of last successful latest analytics partition run | -No | -
keyLastMonitoringRun | -Keeps timestamp of last monitoring run | -No | -
keyLastSuccessfulDataSynch | -Keeps timestamp of last successful data values synchronization | -No | -
keyLastSuccessfulEventsDataSynch | -Keeps timestamp of last successful Event programs data synchronization | -No | -
keyLastCompleteDataSetRegistrationSyncSuccess | -Keeps timestamp of last successful completeness synchronization | -No | -
syncSkipSyncForDataChangedBefore | -Specifies timestamp used to skip synchronization of all the data changed before this point in time | -No | -
keyLastSuccessfulAnalyticsTablesUpdate | -Keeps timestamp of last successful analytics tables update | -No | -
keyLastSuccessfulLatestAnalyticsPartitionUpdate | -Keeps timestamp of last successful latest analytics partition update | -No | -
keyLastSuccessfulResourceTablesUpdate | -Keeps timestamp of last successful resource tables update | -No | -
keyLastSuccessfulSystemMonitoringPush | -Keeps timestamp of last successful system monitoring push | -No | -
keyLastSuccessfulMonitoring | -Keeps timestamp of last successful monitoring | -No | -
keyNextAnalyticsTableUpdate | -Keeps timestamp of next analytics table update | -No | -
helpPageLink | -Link to help page. Default: "https://dhis2.github.io/dhis2-docs/master/en/user/html/dhis2_user_manual_en.html | -No | -
keyAcceptanceRequiredForApproval | -Acceptance required before approval. Default: "false" | -No | -
keySystemNotificationsEmail | -Where to email system notifications | -No | -
keyAnalysisRelativePeriod | -Default relative period for analysis. Default: "LAST_12_MONTHS" | -No | -
keyRequireAddToView | -Require authority to add to view object lists. Default: "false" | -No | -
keyAllowObjectAssignment | -Allow assigning object to related objects during add or update. Default: "false" | -No | -
keyUseCustomLogoFront | -Enables the usage of a custom logo on the front page. Default: "false" | -No | -
keyUseCustomLogoBanner | -Enables the usage of a custom banner on the website. Default: "false" | -No | -
keyDataImportStrictPeriods | -- | No | -
keyDataImportStrictPeriods | -Require periods to match period type of data set. Default: "false" | -No | -
keyDataImportStrictDataElements | -Require data elements to be part of data set. Default: "false" | -No | -
keyDataImportStrictCategoryOptionCombos | -Require category option combos to match category combo of data element. Default: "false" | -No | -
keyDataImportStrictOrganisationUnits | -Require organisation units to match assignment of data set. Default: "false" | -No | -
keyDataImportStrictAttributeOptionsCombos | -Require attribute option combis to match category combo of data set. Default: "false" | -No | -
keyDataImportRequireCategoryOptionCombo | -Require category option combo to be specified. Default: "false" | -No | -
keyDataImportRequireAttributeOptionCombo | -Require attribute option combo to be specified. Default: "false" | -No | -
keyCustomJs | -Custom JavaScript to be used on the website | -No | -
keyCustomCss | -Custom CSS to be used on the website | -No | -
keyCalendar | -The calendar type. Default: "iso8601". | -No | -
keyDateFormat | -The format in which dates should be displayed. Default: "yyyy-MM-dd". | -No | -
keyStyle | -The style used on the DHIS2 webpages. Default: "light_blue/light_blue.css". | -No | -
keyRemoteInstanceUrl | -Url used to connect to remote instance | -No | -
keyRemoteInstanceUsername | -Username used to connect to remote DHIS2 instance | -No | -
keyRemoteInstancePassword | -Password used to connect to remote DHIS2 instance | -No | -
keyGoogleMapsApiKey | -Google Maps API key | -No | -
keyGoogleCloudApiKey | -Google Cloud API key | -No | -
keyLastMetaDataSyncSuccess | -Keeps timestamp of last successful metadata synchronization | -No | -
keyVersionEnabled | -Enables metadata versioning | -No | -
keyMetadataFailedVersion | -Keeps details about failed metadata version sync | -No | -
keyMetadataLastFailedTime | -Keeps timestamp of last metadata synchronization failure | -No | -
keyLastSuccessfulScheduledProgramNotifications | -Not in use | -No | -
keyLastSuccessfulScheduledDataSetNotifications | -Not in use | -No | -
keyRemoteMetadataVersion | -Details about metadata version of remote instance | -No | -
keySystemMetadataVersion | -Details about metadata version of the system | -No | -
keyStopMetadataSync | -Flag to stop metadata synchronization | -No | -
keyFileResourceRetentionStrategy | -Determines how long file resources associated with deleted or updated values are kept. NONE, THREE_MONTHS, ONE_YEAR, or FOREVER. | -No | -
syncMaxRemoteServerAvailabilityCheckAttempts | -Specifies how many times the availability of remote server will be checked before synchronization jobs fail. | -No | -
syncMaxAttempts | -Specifies max attempts for synchronization jobs | -No | -
syncDelayBetweenRemoteServerAvailabilityCheckAttempts | -Delay between remote server availability checks | -No | -
lastSuccessfulDataStatistics | -Keeps timestamp of last successful data analytics | -No | -
keyHideDailyPeriods | -Not in use | -No | -
keyHideWeeklyPeriods | -Not in use | -No | -
keyHideMonthlyPeriods | -Not in use | -No | -
keyHideBiMonthlyPeriods | -Not in use | -No | -
Key | -Options | -Description | -
---|---|---|
keyStyle | -light_blue/light_blue.css | green/green.css | vietnam/vietnam.css | -User interface stylesheet. | -
keyMessageEmailNotification | -false | true | -Whether to send email notifications. | -
keyMessageSmsNotification | -false | true | -Whether to send SMS notifications. | -
keyUiLocale | -Locale value | -User interface locale. | -
keyDbLocale | -Locale value | -Database content locale. | -
keyAnalysisDisplayProperty | -name | shortName | -Property to display for metadata in analysis apps. | -
keyCurrentDomainType | -all | aggregate | tracker | -Data element domain type to display in lists. | -
keyAutoSaveCaseEntryForm | -false | true | -Save case entry forms periodically. | -
keyAutoSaveTrackedEntityForm | -false | true | -Save person registration forms periodically. | -
keyAutoSaveDataEntryForm | -false | true | -Save aggregate data entry forms periodically. | -
keyTrackerDashboardLayout | -false | true | -Tracker dasboard layout. | -
Key | -Description | -
---|---|
logo_banner | -Logo in the application top menu on the left side. | -
logo_front | -Logo on the login-page above the login form. | -
Configuration property | -Value | -
---|---|
feedbackRecipients | -User group ID | -
offlineOrganisationUnitLevel | -Organisation unit level ID | -
infrastructuralDataElements | -Data element group ID | -
infrastructuralIndicators | -Indicator group ID | -
infrastructuralPeriodType | -Period type name (e.g. "Monthly") | -
selfRegistrationRole | -User role ID | -
selfRegistrationOrgUnit | -Organisation unit ID | -
smtpPassword | -SMTP email server password | -
remoteServerUrl | -URL to remote server | -
remoteServerUsername | -Username for remote server authentication | -
remoteServerPassword | -Password for remote server authentication | -
corsWhitelist | -JSON list of URLs | -
Value | -Description | -
---|---|
USER_SETTING | -To get user settings | -
SYSTEM_SETTING | -To get system settings | -
CONFIGURATION | -To get DHIS server settings | -
Query parameter | -Required | -Description | -
---|---|---|
svg | -Yes | -The SVG content | -
filename | -No | -The file name for the returned attachment without file extension | -
Property | -Description | -
---|---|
ownerObject | -The metadata type referenced when generating and reserving the value. Currently only TRACKEDENTITYATTRIBUTE is supported. | -
ownerUid | -The uid of the metadata object referenced when generating and reserving the value. | -
key | -A partially generated value where generated segments are not yet added. | -
value | -The fully resolved value reserved. This is the value you send to the server when storing data. | -
created | -The timestamp when the reservation was made | -
expiryDate | -The timestamp when the reservation will no longer be reserved | -
Query parameter | -Description | -
---|---|
filter | -Attributes to use as a filter for the query. Param can be repeated any number of times. Filters can be applied to a dimension on the format <attribute-id>:<operator>:<filter>[:<operator>:<filter>]. Filter values are case-insensitive and can be repeated together with operator any number of times. Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN. | -
ou | -Organisation unit identifiers, separated by ";". | -
ouMode | -The mode of selecting organisation units, can be SELECTED | CHILDREN | DESCENDANTS | ACCESSIBLE | CAPTURE | ALL. Default is SELECTED, which refers to the selected selected organisation units only. See table below for explanations. | -
program | -Program identifier. Restricts instances to being enrolled in the given program. | -
programStatus | -Status of the instance for the given program. Can be ACTIVE | COMPLETED | CANCELLED. | -
followUp | -Follow up status of the instance for the given program. Can be true | false or omitted. | -
programStartDate | -Start date of enrollment in the given program for the tracked entity instance. | -
programEndDate | -End date of enrollment in the given program for the tracked entity instance. | -
trackedEntity | -Tracked entity identifier. Restricts instances to the given tracked instance type. | -
page | -The page number. Default page is 1. | -
pageSize | -The page size. Default size is 50 rows per page. | -
totalPages | -Indicates whether to include the total number of pages in the paging response (implies higher response time). | -
skipPaging | -Indicates whether paging should be ignored and all rows should be returned. | -
lastUpdatedStartDate | -Filter for events which were updated after this date. Cannot be used together with lastUpdatedDuration. | -
lastUpdatedEndDate | -Filter for events which were updated up until this date. Cannot be used together with lastUpdatedDuration. | -
lastUpdatedDuration | -Include only items which are updated within the given duration. The format is |
-
assignedUserMode | -Restricts result to tei with events assigned based on the assigned user selection mode, can be CURRENT | PROVIDED | NONE | ANY. | -
assignedUser | -Filter the result down to a limited set of teis with events that are assigned to the given user IDs by using assignedUser=id1;id2.This parameter will be considered only if assignedUserMode is either PROVIDED or null. The API will error out, if for example, assignedUserMode=CURRENT and assignedUser=someId | -
trackedEntityInstance | -Filter the result down to a limited set of teis using explicit uids of the tracked entity instances by using trackedEntityInstance=id1;id2. This parameter will at the very least create the outer boundary of the results, forming the list of all teis using the uids provided. If other parameters/filters from this table are used, they will further limit the results from the explicit outer boundary. | -
Mode | -Description | -
---|---|
SELECTED | -Organisation units defined in the request. | -
CHILDREN | -The selected organisation units and the immediate children, i.e. the organisation units at the level below. | -
DESCENDANTS | -The selected organisation units and all children, i.e. all organisation units in the sub-hierarchy. | -
ACCESSIBLE | -The data view organisation units associated with the current user and all children, i.e. all organisation units in the sub-hierarchy. Will fall back to data capture organisation units associated with the current user if the former is not defined. | -
CAPTURE | -The data capture organisation units associated with the current user and all children, i.e. all organisation units in the sub-hierarchy. | -
ALL | -All organisation units in the system. Requires the ALL authority. | -
Operator | -Description | -
---|---|
EQ | -Equal to | -
GT | -Greater than | -
GE | -Greater than or equal to | -
LT | -Less than | -
LE | -Less than or equal to | -
NE | -Not equal to | -
LIKE | -Like (free text match) | -
IN | -Equal to one of multiple values separated by ";" | -
Query parameter | -Description | -
---|---|
query | -Query string. Attribute query parameter can be used to define which attributes to include in the response. If no attributes but a program is defined, the attributes from the program will be used. If no program is defined, all attributes will be used. There are two formats. The first is a plan query string. The second is on the format <operator>:<query>. Operators can be EQ | LIKE. EQ implies exact matches on words, LIKE implies partial matches on words. The query will be split on space, where each word will form a logical AND query. | -
attribute | -Attributes to be included in the response. Can also be used as a filter for the query. Param can be repeated any number of times. Filters can be applied to a dimension on the format <attribute-id>:<operator>:<filter>[:<operator>:<filter>]. Filter values are case-insensitive and can be repeated together with operator any number of times. Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN. Filters can be omitted in order to simply include the attribute in the response without any constraints. | -
filter | -Attributes to use as a filter for the query. Param can be repeated any number of times. Filters can be applied to a dimension on the format <attribute-id>:<operator>:<filter>[:<operator>:<filter>]. Filter values are case-insensitive and can be repeated together with operator any number of times. Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN. | -
ou | -Organisation unit identifiers, separated by ";". | -
ouMode | -The mode of selecting organisation units, can be SELECTED | CHILDREN | DESCENDANTS | ACCESSIBLE | ALL. Default is SELECTED, which refers to the selected organisation units only. See table below for explanations. | -
program | -Program identifier. Restricts instances to being enrolled in the given program. | -
programStatus | -Status of the instance for the given program. Can be ACTIVE | COMPLETED | CANCELLED. | -
followUp | -Follow up status of the instance for the given program. Can be true | false or omitted. | -
programStartDate | -Start date of enrollment in the given program for the tracked entity instance. | -
programEndDate | -End date of enrollment in the given program for the tracked entity instance. | -
trackedEntity | -Tracked entity identifier. Restricts instances to the given tracked instance type. | -
eventStatus | -Status of any event associated with the given program and the tracked entity instance. Can be ACTIVE | COMPLETED | VISITED | SCHEDULED | OVERDUE | SKIPPED. | -
eventStartDate | -Start date of event associated with the given program and event status. | -
eventEndDate | -End date of event associated with the given program and event status. | -
programStage | -The programStage for which the event related filters should be applied to. If not provided all stages will be considered. | -
skipMeta | -Indicates whether meta data for the response should be included. | -
page | -The page number. Default page is 1. | -
pageSize | -The page size. Default size is 50 rows per page. | -
totalPages | -Indicates whether to include the total number of pages in the paging response (implies higher response time). | -
skipPaging | -Indicates whether paging should be ignored and all rows should be returned. | -
assignedUserMode | -Restricts result to tei with events assigned based on the assigned user selection mode, can be CURRENT | PROVIDED | NONE | ANY. | -
assignedUser | -Filter the result down to a limited set of teis with events that are assigned to the given user IDs by using assignedUser=id1;id2.This parameter will be considered only if assignedUserMode is either PROVIDED or null. The API will error out, if for example, assignedUserMode=CURRENT and assignedUser=someId | -
trackedEntityInstance | -Filter the result down to a limited set of teis using explicit uids of the tracked entity instances by using trackedEntityInstance=id1;id2. This parameter will at the very least create the outer boundary of the results, forming the list of all teis using the uids provided. If other parameters/filters from this table are used, they will further limit the results from the explicit outer boundary. | -
Mode | -Description | -
---|---|
SELECTED | -Organisation units defined in the request. | -
CHILDREN | -Immediate children, i.e. only the first level below, of the organisation units defined in the request. | -
DESCENDANTS | -All children, i.e. at only levels below, e.g. including children of children, of the organisation units defined in the request. | -
ACCESSIBLE | -All descendants of the data view organisation units associated with the current user. Will fall back to data capture organisation units associated with the current user if the former is not defined. | -
CAPTURE | -The data capture organisation units associated with the current user and all children, i.e. all organisation units in the sub-hierarchy. | -
ALL | -All organisation units in the system. Requires authority. | -
Operator | -Description | -
---|---|
EQ | -Equal to | -
GT | -Greater than | -
GE | -Greater than or equal to | -
LT | -Less than | -
LE | -Less than or equal to | -
NE | -Not equal to | -
LIKE | -Like (free text match) | -
IN | -Equal to one of multiple values separated by ";" | -
Payload values | -Description | -Example | -
---|---|---|
name | -Name of the filter. Required. | -- |
description | -A description of the filter. | -- |
sortOrder | -The sort order of the filter. Used in Tracker Capture to order the filters in the program dashboard. | -- |
style | -Object containing css style. | -( "color": "blue", "icon": "fa fa-calendar"} | -
program | -Object containing the id of the program. Required. | -{ "id" : "uy2gU8kTjF"} | -
enrollmentStatus | -The TEIs enrollment status. Can be none(any enrollmentstatus) or ACTIVE|COMPLETED|CANCELED | -- |
followup | -When this parameter is true, the filter only returns TEIs that have an enrollment with status followup. | -- |
enrollmentCreatedPeriod | -Period object containing a period in which the enrollment must be created. See Period definition table below. | -{ "periodFrom": -15, "periodTo": 15} | -
eventFilters | -A list of eventFilters. See Event filters definition table below. | -[{"programStage": "eaDH9089uMp", "eventStatus": "OVERDUE", "eventCreatedPeriod": {"periodFrom": -15, "periodTo": 15}}] | -
programStage | -Which programStage the TEI needs an event in to be returned. | -"eaDH9089uMp" | -
eventStatus | -The events status. Can be none(any event status) or ACTIVE|COMPLETED|SCHEDULED|OVERDUE | -ACTIVE | -
eventCreatedPeriod | -Period object containing a period in which the event must be created. See Period definition below. | -{ "periodFrom": -15, "periodTo": 15} | -
assignedUserMode | -To specify the assigned user selection mode for events. Possible values are CURRENT (events assigned to current user)| PROVIDED (events assigned to users provided in "assignedUsers" list) | NONE (events assigned to no one) | ANY (events assigned to anyone). If PROVIDED (or null), non-empty assignedUsers in the payload will be considered. | -"assignedUserMode": "PROVIDED" | -
assignedUsers | -To specify a list of assigned users for events. To be used along with PROVIDED assignedUserMode above. | -"assignedUsers": ["a3kGcGDCuk7", "a3kGcGDCuk8"] | -
periodFrom | -Number of days from current day. Can be positive or negative integer. | --15 | -
periodTo | -Number of days from current day. Must be bigger than periodFrom. Can be positive or negative integer. | -15 | -
Query parameter | -Description | -
---|---|
program | -Program identifier. Restricts filters to the given program. | -
Query parameter | -Description | -
---|---|
ou | -Organisation unit identifiers, separated by ";". | -
ouMode | -The mode of selecting organisation units, can be SELECTED | CHILDREN | DESCENDANTS | ACCESSIBLE | CAPTURE | ALL. Default is SELECTED, which refers to the selected organisation units only. See table below for explanations. | -
program | -Program identifier. Restricts instances to being enrolled in the given program. | -
programStatus | -Status of the instance for the given program. Can be ACTIVE | COMPLETED | CANCELLED. | -
followUp | -Follow up status of the instance for the given program. Can be true | false or omitted. | -
programStartDate | -Start date of enrollment in the given program for the tracked entity instance. | -
programEndDate | -End date of enrollment in the given program for the tracked entity instance. | -
lastUpdatedDuration | -Include only items which are updated within the given duration. The format is |
-
trackedEntity | -Tracked entity identifier. Restricts instances to the given tracked instance type. | -
trackedEntityInstance | -Tracked entity instance identifier. Should not be used together with trackedEntity. | -
page | -The page number. Default page is 1. | -
pageSize | -The page size. Default size is 50 rows per page. | -
totalPages | -Indicates whether to include the total number of pages in the paging response (implies higher response time). | -
skipPaging | -Indicates whether paging should be ignored and all rows should be returned. | -
includeDeleted | -Indicates whether to include soft deleted enrollments or not. It is false by default. | -
Mode | -Description | -
---|---|
SELECTED | -Organisation units defined in the request (default). | -
CHILDREN | -Immediate children, i.e. only the first level below, of the organisation units defined in the request. | -
DESCENDANTS | -All children, i.e. at only levels below, e.g. including children of children, of the organisation units defined in the request. | -
ACCESSIBLE | -All descendants of the data view organisation units associated with the current user. Will fall back to data capture organisation units associated with the current user if the former is not defined. | -
ALL | -All organisation units in the system. Requires authority. | -
Parameter | -Type | -Required | -Options (default first) | -Description | -
---|---|---|---|---|
program | -string | -true | -- | Identifier of the single event with no registration program | -
orgUnit | -string | -true | -- | Identifier of the organisation unit where the event took place | -
eventDate | -date | -true | -- | The date of when the event occurred | -
completedDate | -date | -false | -- | The date of when the event is completed. If not provided, the current date is selected as the event completed date | -
status | -enum | -false | -ACTIVE | COMPLETED | VISITED | SCHEDULE | OVERDUE | SKIPPED | -Whether the event is complete or not | -
storedBy | -string | -false | -Defaults to current user | -Who stored this event (can be username, system-name, etc) | -
coordinate | -double | -false | -- | Refers to where the event took place geographically (latitude and longitude) | -
dataElement | -string | -true | -- | Identifier of data element | -
value | -string | -true | -- | Data value or measure for this event | -
Key | -Type | -Required | -Description | -
---|---|---|---|
program | -identifier | -true (if not programStage is provided) | -Identifier of program | -
programStage | -identifier | -false | -Identifier of program stage | -
programStatus | -enum | -false | -Status of event in program, ca be ACTIVE | COMPLETED | CANCELLED | -
followUp | -boolean | -false | -Whether event is considered for follow up in program, can be true | false or omitted. | -
trackedEntityInstance | -identifier | -false | -Identifier of tracked entity instance | -
orgUnit | -identifier | -true | -Identifier of organisation unit | -
ouMode | -enum | -false | -Org unit selection mode, can be SELECTED | CHILDREN | DESCENDANTS | -
startDate | -date | -false | -Only events newer than this date | -
endDate | -date | -false | -Only events older than this date | -
status | -enum | -false | -Status of event, can be ACTIVE | COMPLETED | VISITED | SCHEDULED | OVERDUE | SKIPPED | -
lastUpdatedStartDate | -date | -false | -Filter for events which were updated after this date. Cannot be used together with lastUpdatedDuration. | -
lastUpdatedEndDate | -date | -false | -Filter for events which were updated up until this date. Cannot be used together with lastUpdatedDuration. | -
lastUpdatedDuration | -string | -false | -Include only items which are updated within the given duration. The format is |
-
skipMeta | -boolean | -false | -Exclude the meta data part of response (improves performance) | -
page | -integer | -false | -Page number | -
pageSize | -integer | -false | -Number of items in each page | -
totalPages | -boolean | -false | -Indicates whether to include the total number of pages in the paging response. | -
skipPaging | -boolean | -false | -Indicates whether to skip paging in the query and return all events. | -
dataElementIdScheme | -string | -false | -Data element ID scheme to use for export, valid options are UID, CODE and ATTRIBUTE:{ID} | -
categoryOptionComboIdScheme | -string | -false | -Category Option Combo ID scheme to use for export, valid options are UID, CODE and -ATTRIBUTE:{ID} | -
orgUnitIdScheme | -string | -false | -Organisation Unit ID scheme to use for export, valid options are UID, CODE and -ATTRIBUTE:{ID} | -
programIdScheme | -string | -false | -Program ID scheme to use for export, valid options are UID, CODE and ATTRIBUTE:{ID} | -
programStageIdScheme | -string | -false | -Program Stage ID scheme to use for export, valid options are UID, CODE and ATTRIBUTE:{ID} | -
idScheme | -string | -false | -Allows to set id scheme for data element, category option combo, orgUnit, program and program -stage at once. | -
order | -string | -false | -The order of which to retrieve the events from the API. Usage: order=<property>:asc/desc - Ascending order is default.
- Properties: event | program | programStage | enrollment | enrollmentStatus | orgUnit | orgUnitName | trackedEntityInstance | eventDate | followup | status | dueDate | storedBy | created | lastUpdated | completedBy | completedDate -
-
|
-
event | -comma delimited string | -false | -Filter the result down to a limited set of IDs by using event=id1;id2. | -
skipEventId | -boolean | -false | -Skips event identifiers in the response | -
attributeCc (**) | -string | -false | -Attribute category combo identifier (must be combined with attributeCos) | -
attributeCos (**) | -string | -false | -Attribute category option identifiers, separated with ; (must be combined with attributeCc) | -
async | -false | true | -false | -Indicates whether the import should be done asynchronous or synchronous. | -
includeDeleted | -boolean | -false | -When true, soft deleted events will be included in your query result. | -
assignedUserMode | -enum | -false | -Assigned user selection mode, can be CURRENT | PROVIDED | NONE | ANY. | -
assignedUser | -comma delimited strings | -false | -Filter the result down to a limited set of events that are assigned to the given user IDs by using assignedUser=id1;id2. This parameter will be considered only if assignedUserMode is either PROVIDED or null. The API will error out, if for example, assignedUserMode=CURRENT and assignedUser=someId | -
Request Property | -Description | -Example | -
---|---|---|
name | -Name of the filter. | -"name":"My working list" | -
description | -A description of the filter. | -"description":"for listing all events assigned to me". | -
program | -The uid of the program. | -"program" : "a3kGcGDCuk6" | -
programStage | -The uid of the program stage. | -"programStage" : "a3kGcGDCuk6" | -
eventQueryCriteria | -Object containing parameters for querying, sorting and filtering events. | -- "eventQueryCriteria": { - "organisationUnit":"a3kGcGDCuk6", - "status": "COMPLETED", - "createdDate": { - "from": "2014-05-01", - "to": "2019-03-20" - }, - "dataElements": ["a3kGcGDCuk6:EQ:1", "a3kGcGDCuk6"], - "filters": ["a3kGcGDCuk6:EQ:1"], - "programStatus": "ACTIVE", - "ouMode": "SELECTED", - "assignedUserMode": "PROVIDED", - "assignedUsers" : ["a3kGcGDCuk7", "a3kGcGDCuk8"], - "followUp": false, - "trackedEntityInstance": "a3kGcGDCuk6", - "events": ["a3kGcGDCuk7", "a3kGcGDCuk8"], - "fields": "eventDate,dueDate", - "order": "dueDate:asc,createdDate:desc" - } - | -
followUp | -Used to filter events based on enrollment followUp flag. Possible values are true|false. | -"followUp": true | -
organisationUnit | -To specify the uid of the organisation unit | -"organisationUnit": "a3kGcGDCuk7" | -
ouMode | -To specify the OU selection mode. Possible values are SELECTED| CHILDREN|DESCENDANTS|ACCESSIBLE|CAPTURE|ALL | -"ouMode": "SELECTED" | -
assignedUserMode | -To specify the assigned user selection mode for events. Possible values are CURRENT| PROVIDED| NONE | ANY. See table below to understand what each value indicates. If PROVIDED (or null), non-empty assignedUsers in the payload will be considered. | -"assignedUserMode": "PROVIDED" | -
assignedUsers | -To specify a list of assigned users for events. To be used along with PROVIDED assignedUserMode above. | -"assignedUsers": ["a3kGcGDCuk7", "a3kGcGDCuk8"] | -
displayOrderColumns | -To specify the output ordering of columns | -"displayOrderColumns": ["eventDate", "dueDate", "program"] | -
order | -To specify ordering/sorting of fields and its directions in comma separated values. A single item in order is of the form "dataItem:direction". | -"order"="a3kGcGDCuk6:desc,eventDate:asc" | -
dataFilters | -To specify filters to be applied when listing events | -"dataFilters"=[{ - "dataItem": "abcDataElementUid", - "le": "20", - "ge": "10", - "lt": "20", - "gt": "10", - "in": ["India", "Norway"], - "like": "abc", - "dateFilter": { - "startDate": "2014-05-01", - "endDate": "2019-03-20", - "startBuffer": -5, - "endBuffer": 5, - "period": "LAST_WEEK", - "type": "RELATIVE" - } - }] | -
status | -Any valid EventStatus | -"eventStatus": "COMPLETED" | -
events | -To specify list of events | -"events"=["a3kGcGDCuk6"] | -
completedDate | -DateFilterPeriod object date filtering based on completed date. | -- "completedDate": { - "startDate": "2014-05-01", - "endDate": "2019-03-20", - "startBuffer": -5, - "endBuffer": 5, - "period": "LAST_WEEK", - "type": "RELATIVE" - } - | -
eventDate | -DateFilterPeriod object date filtering based on event date. | -- "eventDate": { - "startBuffer": -5, - "endBuffer": 5, - "type": "RELATIVE" - } - | -
dueDate | -DateFilterPeriod object date filtering based on due date. | -- "dueDate": { - "period": "LAST_WEEK", - "type": "RELATIVE" - } - | -
lastUpdatedDate | -DateFilterPeriod object date filtering based on last updated date. | -- "lastUpdatedDate": { - "startDate": "2014-05-01", - "endDate": "2019-03-20", - "type": "ABSOLUTE" - } - | -
type | -Specify whether the date period type is ABSOLUTE | RELATIVE | -"type" : "RELATIVE" | -
period | -Specify if a relative system defined period is to be used. Applicable only when "type" is RELATIVE. (see Relative Periods for supported relative periods) | -"period" : "THIS_WEEK" | -
startDate | -Absolute start date. Applicable only when "type" is ABSOLUTE | -"startDate":"2014-05-01" | -
endDate | -Absolute end date. Applicable only when "type" is ABSOLUTE | -"startDate":"2014-05-01" | -
startBuffer | -Relative custom start date. Applicable only when "type" is RELATIVE | -"startBuffer":-10 | -
endBuffer | -Relative custom end date. Applicable only when "type" is RELATIVE | -"startDate":+10 | -
Mode | -Description | -
---|---|
CURRENT | -Assigned to the current logged in user | -
PROVIDED | -Assigned to the users provided in the "assignedUser" parameter | -
NONE | -Assigned to no users. | -
ANY | -Assigned to any users. | -
Parameter | -Description | -
---|---|
CREATE | -Create only, this is the default behavior. | -
CREATE_AND_UPDATE | -Try and match the ID, if it exist then update, if not create. | -
Parameter | -Values (default first) | -Description | -
---|---|---|
dataElementIdScheme | -id | name | code | attribute:ID | -Property of the data element object to use to map the data values. | -
orgUnitIdScheme | -id | name | code | attribute:ID | -Property of the org unit object to use to map the data values. | -
idScheme | -id | name | code| attribute:ID | -Property of all objects including data elements, org units and category option combos, to use to map the data values. | -
dryRun | -false | true | -Whether to save changes on the server or just return the import summary. | -
strategy | -CREATE | UPDATE | CREATE_AND_UPDATE | DELETE | -Save objects of all, new or update import status on the server. | -
skipNotifications | -true | false | -Indicates whether to send notifications for completed events. | -
skipFirst | -true | false | -Relevant for CSV import only. Indicates whether CSV file contains a header row which should be skipped. | -
importReportMode | -FULL, ERRORS, DEBUG | -Sets the `ImportReport` mode, controls how much is reported back after the import is done. `ERRORS` only includes ObjectReports for object which has errors. `FULL` returns an ObjectReport for all objects imported, and `DEBUG` returns the same plus a name for the object (if available). | -
Index | -Key | -Type | -Description | -
---|---|---|---|
1 | -event | -identifier | -Identifier of event | -
2 | -status | -enum | -Status of event, can be ACTIVE | COMPLETED | VISITED | SCHEDULED | OVERDUE | SKIPPED | -
3 | -program | -identifier | -Identifier of program | -
4 | -programStage | -identifier | -Identifier of program stage | -
5 | -enrollment | -identifier | -Identifier of enrollment (program instance) | -
6 | -orgUnit | -identifier | -Identifier of organisation unit | -
7 | -eventDate | -date | -Event date | -
8 | -dueDate | -date | -Due Date | -
9 | -latitude | -double | -Latitude where event happened | -
10 | -longitude | -double | -Longitude where event happened | -
11 | -dataElement | -identifier | -Identifier of data element | -
12 | -value | -string | -Value / measure of event | -
13 | -storedBy | -string | -Event was stored by (defaults to current user) | -
14 | -providedElsewhere | -boolean | -Was this value collected somewhere else | -
14 | -completedDate | -date | -Completed date of event | -
14 | -completedBy | -string | -Username of user who completed event | -
Property | -Description | -Type | -
---|---|---|
name | -Name of the job. | -String | -
cronExpression | -The cron expression which defines the interval for when the job should run. | -String (Cron expression) | -
jobType | -The job type represent which task is run. In the next table, you can get an overview of existing job types. Each job type can have a specific set of parameters for job configuration. | -String (Enum) | -
jobParameters | -Job parameters, if applicable for job type. | -(See list of job types) | -
enabled | -A job can be added to the system without it being scheduled by setting `enabled` to false in the JSON payload. Use this if you want to temporarily stop scheduling for a job, or if a job configuration is not complete yet. | -Boolean | -
Job type | -Parameters | -Param(Type:Default) | -
---|---|---|
DATA_INTEGRITY | -NONE | -- |
ANALYTICS_TABLE | -
|
-
|
-
CONTINUOUS_ANALYTICS_TABLE | -
|
-
|
-
DATA_SYNC | -NONE | -- |
META_DATA_SYNC | -NONE | -- |
SEND_SCHEDULED_MESSAGE | -NONE | -- |
PROGRAM_NOTIFICATIONS | -NONE | -- |
MONITORING (Validation rule analysis) | -
|
-
|
-
PUSH_ANALYSIS | -
|
-
|
-
PREDICTOR | -
|
-
|
-
Item | -Description | -Data type | -
---|---|---|
Namespace | -Namespace for organization of entries. | -String | -
Key | -Key for identification of values. | -String | -
Value | -Value holding the information for the entry. | -JSON | -
Encrypted | -Indicates whether the value of the given key should be encrypted | -Boolean | -
Item | -Description | -Data Type | -
---|---|---|
User | -The user this data is associated with | -String | -
Namespace | -The namespace the key belongs to | -String | -
Key | -The key a value is stored on | -String | -
Value | -The value stored | -JSON | -
Encrypted | -Indicates whether the value should be encrypted | -Boolean | -
Item | -Description | -Data type | -
---|---|---|
source | -Organisation unit identifier | -String | -
dataElement | -Data element identifier | -String | -
optionCombo | -Data element category option combo identifier | -String | -
min | -Minimum value | -Integer | -
max | -Maximum value | -Integer | -
generated | -Indicates whether this object is generated by the system (and not set manually). | -Boolean | -
Property | -Description | -
---|---|
access_token | -The OAuth 2.0 access token to be used when authentication against Google services. | -
expires_in | -The number of seconds until the access token expires, typically 3600 seconds (1 hour). | -
client_id | -The Google service account client id. | -
Field | -Options | -Description | -
---|---|---|
name | -Text | -Name of the hook. | -
phase | -RESOURCE_TABLE_POPULATED, ANALYTICS_TABLE_POPULATED | -The phase for when the SQL script should be invoked. | -
resourceTableType | -See column "Table type" in table "Phases, table types and temporary tables" below |
-The type of resource table for which to invoke the SQL script. Applies only for hooks defined with the RESOURCE_TABLE_POPULATED phase. | -
analyticsTableType | -See column "Table type" in table "Phases, table types and temporary tables" below | -The type of analytics table for which to invoke the SQL script. Applies only for hooks defined with the ANALYTICS_TABLE_POPULATED phase. | -
sql | -Text | -The SQL script to invoke. | -
Phase | -Table type | -Temporary table | -
---|---|---|
RESOURCE_TABLE_POPULATED | -ORG_UNIT_STRUCTURE | -_orgunitstructure_temp | -
DATA_SET_ORG_UNIT_CATEGORY | -_datasetorgunitcategory_temp | -|
CATEGORY_OPTION_COMBO_NAME | -_categoryoptioncomboname_temp | -|
DATA_ELEMENT_GROUP_SET_STRUCTURE | -_dataelementgroupsetstructure_temp | -|
INDICATOR_GROUP_SET_STRUCTURE | -_indicatorgroupsetstructure_temp | -|
ORG_UNIT_GROUP_SET_STRUCTURE | -_organisationunitgroupsetstructure_temp | -|
CATEGORY_STRUCTURE | -_categorystructure_temp | -|
DATA_ELEMENT_STRUCTURE | -_dataelementstructure_temp | -|
PERIOD_STRUCTURE | -_periodstructure_temp | -|
DATE_PERIOD_STRUCTURE | -_dateperiodstructure_temp | -|
DATA_ELEMENT_CATEGORY_OPTION_COMBO | -_dataelementcategoryoptioncombo_temp | -|
DATA_APPROVAL_MIN_LEVEL | -_dataapprovalminlevel_temp | -|
ANALYTICS_TABLE_POPULATED | -DATA_VALUE | -analytics_temp | -
COMPLETENESS | -analytics_completeness_temp | -|
COMPLETENESS_TARGET | -analytics_completenesstarget_temp | -|
ORG_UNIT_TARGET | -analytics_orgunittarget_temp | -|
EVENT | -analytics_event_temp_<program-uid> | -|
ENROLLMENT | -analytics_enrollment_temp_<program-uid> | -|
VALIDATION_RESULT | -analytics_validationresult_temp | -
Query parameter | +Required | +Description | +Options (default first) | +
---|---|---|---|
dimension | +Yes | +Dimensions and dimension items to be retrieved, repeated for each. | +Any dimension | +
filter | +No | +Filters and filter items to apply to the query, repeated for each. | +Any dimension | +
aggregationType | +No | +Aggregation type to use in the aggregation process. | +SUM | AVERAGE | AVERAGE_SUM_ORG_UNIT | LAST | LAST_AVERAGE_ORG_UNIT | COUNT | STDDEV | VARIANCE | MIN | MAX | +
measureCriteria | +No | +Filters for the data/measures. | +EQ | GT | GE | LT | LE | +
preAggregationMeasureCriteria | +No | +Filters for the data/measure, applied before aggregation is performed. | +EQ | GT | GE | LT | LE | +
startDate | +No | +Start date for a date range. Will be applied as a filter. Can not be used together with a period dimension or filter. | +Date | +
endDate | +No | +End date for date range. Will be applied as a filter. Can not be used together with a period dimension or filter. | +Date | +
skipMeta | +No | +Exclude the metadata part of the response (improves performance). | +false | true | +
skipData | +No | +Exclude the data part of the response. | +false | true | +
skipRounding | +No | +Skip rounding of data values, i.e. provide full precision. | +false | true | +
hierarchyMeta | +No | +Include names of organisation unit ancestors and hierarchy paths of organisation units in the metadata. | +false | true | +
ignoreLimit | +No | +Ignore limit on max 50 000 records in response - use with care. | +false | true | +
tableLayout | +No | +Use plain data source or table layout for the response. | +false | true | +
hideEmptyRows | +No | +Hides empty rows in response, applicable when table layout is true. | +false | true | +
hideEmptyColumns | +No | +Hides empty columns in response, applicable when table layout is true. | +false | true | +
showHierarchy | +No | +Display full org unit hierarchy path together with org unit name. | +false | true | +
includeNumDen | +No | +Include the numerator and denominator used to calculate the value in the response. | +false | true | +
includeMetadataDetails | +No | +Include metadata details to raw data response. | +false | true | +
displayProperty | +No | +Property to display for metadata. | +NAME | SHORTNAME | +
outputIdScheme | +No | +Identifier scheme to use for metadata items the query response, can be identifier, code or attributes. | +UID | CODE |NAME| ATTRIBUTE:<ID> | +
inputIdScheme | +No | +Identifier scheme to use for metadata items in the query request, can be an identifier, code or attributes. | +UID | CODE | ATTRIBUTE:<ID> | +
approvalLevel | +No | +Include data which has been approved at least up to the given approval level, refers to identifier of approval level. | +Identifier of approval level | +
relativePeriodDate | +No | +Date used as basis for relative periods. | +Date. | +
userOrgUnit | +No | +Explicitly define the user org units to utilize, overrides organisation units associated with the current user, multiple identifiers can be separated by semicolon. | +Organisation unit identifiers. | +
columns | +No | +Dimensions to use as columns for table layout. | +Any dimension (must be query dimension) | +
rows | +No | +Dimensions to use as rows for table layout. | +Any dimension (must be query dimension) | +
order | +No | +Specify the ordering of rows based on value. | +ASC | DESC | +
timeField | +No | +The time field to base event aggregation on. Applies to event data items only. Can be a predefined option or the ID of an attribute or data element with a time-based value type. | +EVENT_DATE | ENROLLMENT_DATE | INCIDENT_DATE | DUE_DATE | COMPLETED_DATE | CREATED | LAST_UPDATED | <Attribute ID> | <Data element ID> | +
orgUnitField | +No | +The organisation unit field to base event aggregation on. Applies to event data items only. Can be the ID of an attribute or data element with the Organisation unit value type. The default option is specified as omitting the query parameter. + | <Attribute ID> | <Data element ID> | +
Dimension | +Dimension id | +Dimension items | +
---|---|---|
Data elements, indicators, data set reporting rate metrics, data element operands, program indicators, program data elements, program attributes, validation rules | +dx | +Data element, indicator, data set reporting rate metrics, data element operand, program indicator, program attribute identifiers, keyword DE_GROUP-<group-id>, IN_GROUP-<group-id>, use <dataelement-id>.<optioncombo-id> for data element operands, <program-id>.<dataelement-id> for program data elements, <program-id>.<attribute-id> for program attributes, <validationrule-id> for validation results. | +
Periods (time) | +pe | +ISO periods and relative periods, see "date and period format" | +
Organisation unit hierarchy | +ou | +Organisation unit identifiers, and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | +
Category option combinations | +co | +Category option combo identifiers (omit to get all items) | +
Attribute option combinations | +ao | +Category option combo identifiers (omit to get all items) | +
Categories | +<category id> | +Category option identifiers (omit to get all items) | +
Data element group sets | +<group set id> | +Data element group identifiers (omit to get all items) | +
Organisation unit group sets | +<group set id> | +Organisation unit group identifiers (omit to get all items) | +
Category option group sets | +<group set id> | +Category option group identifiers (omit to get all items) | +
Type | +Syntax | +Description | +Data source | +
---|---|---|---|
Indicator | +<indicator-id> | +Indicator identifier. | +Aggregated data | +
Indicator grop | +IN_GROUP-<indicatorgroup-id> | +Keyword followed by an indicator group identifier. Will include all indicators in the group in the response. | +Aggregated data | +
Data element | +<dataelement-id> | +Data element identifier. | +Aggregated data | +
Data element group | +DE_GROUP-<dataelementgroup-id> | +Keyword followed by a data element group identifier. Will include all data elements in the group in the response. | +Aggregated data | +
Data element operand | +<dataelement-id>.<categoryoptcombo-id>.<attributeoptcombo-id> | +Data element identifier followed by one or both of category option combination and attribute option combo identifier. Wildcard "*" symbol can be used to indicate any option combination value. The attribute option combination identifier can be completely left out. | +Aggregate data | +
Data set | +<dataset-id>.<reporting-rate-metric> | +Data set identifier followed by reporting rate metric. Can be REPORTING_RATE | REPORTING_RATE_ON_TIME | ACTUAL_REPORTS | ACTUAL_REPORTS_ON_TIME | EXPECTED_REPORTS. | +Data set completeness registrations | +
Program data element | +<program-id>.<dataelement-id> | +Program identifier followed by data element identifier. Reads from events within the specified program. | +Events from the given program | +
Program indicator | +<programindicator-id> | +Program indicator identifier. Reads from events from within the program associated with the program identifier. | +Events from the program of the program indicator | +
Validation result | +<validationrule-id> | +Validation rule identifier. Will include validation rule violations for the validation rule, requires that validation results are generated and persisted. | +Validation results | +
Query parameter | +Required / Notes | +
---|---|
dimension | +Yes | +
startDate | +No / yyyy-MM-dd | +
endDate | +No / yyyy-MM-dd | +
skipMeta | +No | +
skipData | +No | +
hierarchyMeta | +No | +
showHierarchy | +No | +
displayProperty | +No | +
outputIdScheme | +No | +
inputIdScheme | +No | +
userOrgUnit | +No | +
Dimension | +Dimension id | +Description | +
---|---|---|
Data elements | +<id> | +Data element identifiers | +
Attributes | +<id> | +Attribute identifiers | +
Periods | +pe | +ISO periods and relative periods, see "date and period format" | +
Organisation units | +ou | +Organisation unit identifiers and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | +
Organisation unit group sets | +<org unit group set id> | +Organisation unit group set identifiers | +
Categories | +<category id> | +Category identifiers (program attribute categories only) | +
Query parameter | +Required | +Description | +Options (default first) | +
---|---|---|---|
program | +Yes | +Program identifier. | +Any program identifier | +
stage | +No | +Program stage identifier. | +Any program stage identifier | +
startDate | +Yes | +Start date for events. | +Date in yyyy-MM-dd format | +
endDate | +Yes | +End date for events. | +Date in yyyy-MM-dd format | +
dimension | +Yes | +Dimension identifier including data elements, attributes, program indicators, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | +Operators can be EQ | GT | GE | LT | LE | NE | LIKE | IN | +
filter | +No | +Dimension identifier including data elements, attributes, periods, organisation units and organisation unit group sets. Parameter can be repeated any number of times. Item filters can be applied to a dimension on the format <item-id>:<operator>:<filter>. Filter values are case-insensitive. | ++ |
hierarchyMeta | +No | +Include names of organisation unit ancestors and hierarchy paths of organisation units in the metadata. | +false | true | +
eventStatus | +No | +Specify status of events to include. | +ACTIVE | COMPLETED | SCHEDULE | OVERDUE | SKIPPED | +
programStatus | +No | +Specify enrollment status of events to include. | +ACTIVE | COMPLETED | CANCELLED | +
relativePeriodDate | +string | +No | +Date identifier e.g: "2016-01-01". Overrides the start date of the relative period | +
columns | +No | +Dimensions to use as columns for table layout. | +Any dimension (must be query dimension) | +
rows | +No | +Dimensions to use as rows for table layout. | +Any dimension (must be query dimension) | +
Query parameter | +Required | +Description | +Options | +
---|---|---|---|
ouMode | +No | +The mode of selecting organisation units. Default is DESCENDANTS, meaning all sub units in the hierarchy. CHILDREN refers to immediate children in the hierarchy; SELECTED refers to the selected organisation units only. | +DESCENDANTS, CHILDREN, SELECTED | +
asc | +No | +Dimensions to be sorted ascending, can reference event date, org unit name and code and any item identifiers. | +EVENTDATE | OUNAME | OUCODE | item identifier | +
desc | +No | +Dimensions to be sorted descending, can reference event date, org unit name and code and any item identifiers. | +EVENTDATE | OUNAME | OUCODE | item identifier | +
coordinatesOnly | +No | +Whether to only return events which have coordinates. | +false | true | +
dataIdScheme | +No | +Id scheme to be used for data, more specifically data elements and attributes which have an option set or legend set, e.g. return the name of the option instead of the code, or the name of the legend instead of the legend ID, in the data response. | +NAME | CODE | UID | +
page | +No | +The page number. Default page is 1. | +Numeric positive value | +
pageSize | +No | +The page size. Default size is 50 items per page. | +Numeric zero or positive value | +
Query parameter | +Required | +Description | +Options | +
---|---|---|---|
value | +No | +Value dimension identifier. Can be a data element or an attribute which must be of numeric value type. | +Data element or attribute identifier | +
aggregationType | +No | +Aggregation type for the value dimension. Default is AVERAGE. | +SUM | AVERAGE | AVERAGE_SUM_ORG_UNIT | LAST | LAST_AVERAGE_ORG_UNIT | COUNT | STDDEV | VARIANCE | MIN | MAX | +
showHierarchy | +No | +Display full org unit hierarchy path together with org unit name. | +false | true | +
displayProperty | +No | +Property to display for metadata. | +NAME | SHORTNAME | +
sortOrder | +No | +Sort the records on the value column in ascending or descending order. | +ASC | DESC | +
limit | +No | +The maximum number of records to return. Cannot be larger than 10 000. | +Numeric positive value | +
outputType | +No | +Specify output type for analytical data which can be events, enrollments or tracked entity instances. The two last options apply to programs with registration only. | +EVENT | ENROLLMENT | TRACKED_ENTITY_INSTANCE | +
collapseDataDimensions | +No | +Collapse all data dimensions (data elements and attributes) into a single dimension in the response. | +false | true | +
skipMeta | +No | +Exclude the meta data part of the response (improves performance). | +false | true | +
skipData | +No | +Exclude the data part of the response. | +false | true | +
skipRounding | +No | +Skip rounding of aggregate data values. | +false | true | +
aggregateData | +No | +Produce aggregate values for the data dimensions (as opposed to dimension items). | +false | true | +
timeField | +No | +The time field to base event aggregation on. Applies to event data items only. Can be a predefined option or the ID of an attribute or data element having a time-based value type. | +EVENT_DATE | ENROLLMENT_DATE | INCIDENT_DATE | DUE_DATE | COMPLETED_DATE | <Attribute ID> | <Data element ID> | +
orgUnitField | +No | +The organisation unit field to base event aggregation on. Applies to event data items only. Can be the ID of an attribute or data element with the Organisation unit value type. The default option is specified as omitting the query parameter. + | <Attribute ID> | <Data element ID> | +
Query parameter | +Required | +Description | +Options | +
---|---|---|---|
clusterSize | +Yes | +Size of clusters in meters. | +Numeric positive value | +
coordinateField | +No | +Field to base geospatial event analytics on. Default is event. Can be set to identifiers of attributes and data elements of value type coordinate. | +EVENT | <attribute-id> | <dataelement-id> | +
bbox | +Yes | +Bounding box / area of events to include in the response on the format "min longitude, min latitude, max longitude , max latitude". | +String | +
includeClusterPoints | +No | +Include information about underlying points for each cluster, be careful if cluster represent a very high number of points. | +false | true | +
Operator | +Description | +
---|---|
EQ | +Equal to | +
GT | +Greater than | +
GE | +Greater than or equal to | +
LT | +Less than | +
LE | +Less than or equal to | +
NE | +Not equal to | +
LIKE | +Like (free text match) | +
IN | +Equal to one of multiple values separated by ";" | +
Dimension | +Dimension id | +Description | +
---|---|---|
Data elements in program stages | +<program stage id>.<data element id> | +Data element identifiers must include the program stage when querying data for enrollments. + + dimension=edqlbukwRfQ.vANAXwtLwcT + + | +
Attributes | +<id> | +Attribute identifiers | +
Periods | +pe | +ISO periods and relative periods, see "date and period format" | +
Organisation units | +ou | +Organisation unit identifiers and keywords USER_ORGUNIT, USER_ORGUNIT_CHILDREN, USER_ORGUNIT_GRANDCHILDREN, LEVEL-<level> and OU_GROUP-<group-id> | +