How can I update organisationunit record using API and a custom app

I want to update our organisationunit record programmatically using api endpoint and a custom app.

I want to create some attribute fields for the facilities and would like to update some of the facility fields and the attribute fields using the custom app.

What is the appropriate payload/endpoint including if I am uploading image and coordinates.

Hi @jetisco4u

I recommend testing first by going to the Maintenance app, opening the Network tab in DevTools, and then after saving with the changes to the OU configuration, check the network requests.

After understanding which endpoints the frontend is using, you can then make use of the same endpoints and create your own Data Queries and Mutations.

1 Like

I tried using PUT for data mutation but got the error

httpStatus: "Method Not Allowed", httpStatusCode: 405, status: "ERROR",…}
httpStatus
: 
"Method Not Allowed"
httpStatusCode
: 
405
message
: 
"Request method 'PUT' not supported"
status
: 
"ERROR"

@jetisco4u are you able to share the payload you are posting

1 Like

I was able to finally push the update except for attributeValues

1 Like