OCHA Integration - Research Summary
Last updated
Last updated
This is a detailed summary of initial research on how to integrate the systems. See child pages for documentation of actual implementation.
Detailed documentation is available here:
This documentation is intended for users of the HPC Service public API, which provides data in JSON or XML formats.
For the API v2 endpoints (currently only data for Chad 2018 is available).
Old OPS API does not provide any documentation.
Access to API is public, however there is limit to 1 request per second. Logged users does not have this limitation. API is using HTTP Basic Authentication.
Synced models should be updated with additional fields, to document their origin. This is achieved using a dedicated base model class.
Column
Type
external_id
integer
external_source
choice - HPC or OPS
All further mappings includes those fields by default.
Endpoint get a list of current Response Plans in given country:
https://api.hpc.tools/v1/public/plan/country/<COUNTRY_ISO>
PRP Response Plan
HPC Plan
title
name
workspace
emergencies[0] if present else use locations[0]
start
startDate
end
endDate
plan_type
categories -> name
OCHA provided sample JSON outputs for some plans:
To get details of response plan, another endpoint is required:
https://api.hpc.tools/v1/public/rpm/plan/id/<plan_id>
Same endpoints returns different values depends on content parameter:
There is a global cluster list, but then plans/responses can have their own cluster names sometimes as well.
However same Cluster name contains different ID's for different plans, example:
Endpoint for access global Clusters list:
https://api.hpc.tools/v1/public/global-cluster
Field mapping
https://api.hpc.tools/v1/public/rpm/plan/id/{id}?content=entities
PRP Cluster model fields
RPM Plan API fields
type
governingEntities -> name
(1)
response_plan
id
To retrieve cluster activities it has to be used content=entities parameter:
https://api.hpc.tools/v1/public/rpm/plan/id/<plan_id>?content=entities
PRP Cluster Activity model fields
RPM Plan API fields
title
planEntities -> value -> description
(1)
cluster_objective
support
(2)
locations
attachments
(3)
reportables
attachments
(4)
To retrieve cluster objectives it has to be used content=entities parameter:
https://api.hpc.tools/v1/public/rpm/plan/id/<plan_id>?content=entities
PRP Cluster Objective model fields
RPM Plan API fields
title
planEntities -> value -> description
(1)
cluster
parent -> parentId
(2)
locations
attachments
(3)
reportables
attachments
(4)
To retrieve disaggregation data it has to be used content=measurements parameter:
https://api.hpc.tools/v1/public/rpm/plan/id/<plan_id>?content=measurements
PRP Reportable model fields
RPM Plan API fields