← Back to team overview

dhis2-devs team mailing list archive

FRED API

 

Hi there,

 

I was trying to get started with FRED API following the documentation that
can be found here

 

 <http://www.dhis2.org/doc/snapshot/en/user/html/ch25s21.html>
http://www.dhis2.org/doc/snapshot/en/user/html/ch25s21.html

 

Get all facilities or Get a specific facility based on either UID or UUID I
already can do, but I'm struggling to create a new Facility.  The example
has

 

curl -u username:password -X POST -d @new_facility.json  -H "Content-Type:
application/json" http://
<http://%3cserver-url%3e/api-fred/v1/facilities.json>
<server-url>/api-fred/v1/facilities.json

 

but I couldn’t find the content of the file new_facility.json.  Based on
specification,  <http://facilityregistry.org/#create-facility>
http://facilityregistry.org/#create-facility, we only need to specify
facility name like this:

 

{

    name: "Kakamega HC"

}

 

Running 

curl -u admin:district -X POST -d @demo.json -H "Content-Type:
application/json" http://localhost:8081/api-fred/v1/facilities.json 

 

I’m getting always Error 400 - the request sent by the client was
syntactically incorrect.

 

Kind regards,

Paulo Grácio


Follow ups