dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32332
Re: Creating Data Elements using the API
Hi James
We have a schema-generator at /api/schemas/type (/api/schemas/dataElement),
sadly this is not done yet, as possible options for enums etc are not
listed.
The only real solution to this today, is to create a few data-elements that
has the options you want to import, then go to /api/dataElement/ID and
export it.. and look at the payload.
--
Morten
On Mon, Aug 25, 2014 at 6:38 PM, James Muranga <jmured@xxxxxxxxx> wrote:
> Hello,
> Hope everyone is okay.
> We are working on creating a simple tool to automate how we setup data
> elements on a dhis2 instance.
> We are using a rest client to post json to the endpoint /api/dataElements
> to create an element.
> We are using the demo instance to test and it gives us an interesting
> error about a failed not null constraint on the column valuetype. This
> also happens when we provided values e.g valuetype:string or
> valueType:string , has anyone else experienced the same ? Or could you
> guide us on how we can get around this problem.
>
> Is there way to see which fields are required ?
> We have attached the output from the api call.
>
> --
> Muranga James
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References