Creating submissions

Hi folks,

I would like to create XML submissions manually. I am using the v2 API and pulling down the form via: …/api/v2/assets/formId/.

I am looking for the “formhub” uuid. For example, an Enketo generated submission looks like this:

<?xml version="1.0" ?>
<data xmlns:jr="http://openrosa.org/javarosa" xmlns:orx="http://openrosa.org/xforms" id="aasxredactedredacted" version="1 (2024-05-23 16:33:43)">
  <formhub>
    <uuid>cadc7c2996ae4aae97519e756ecf8029</uuid>
  </formhub>
  <start>2024-06-04T09:00:50.816-07:00</start>
  <end>2024-06-04T09:00:50.816-07:00</end>
  <Record_your_current_location/>
  <New_Question/>
  <__version__>vEhcDnFhfdqg7iXAqGyPeD</__version__>
  <meta>
    <instanceID>uuid:3a36aa9e-649a-4211-8140-c8610e965d2e</instanceID>
  </meta>
</data>

How can I retrieve the formhub uuid? Note that it is no present anywhere in the form definition.

Thanks!

hi @justinsven, Welcome back to community!

You can find it under API v1. https://kc-eu.kobotoolbox.org/api/v1/forms, find your form name and you will find uuid variable there, this is the uuid value you are looking for

1 Like

Hi.

I am using the global server (kf.kobotoolbox.org) with the v2 API. The token I have does not work on kc-eu.kobotoolbox.org. Am I missing something?

Is it recommended to use the v1 API in conjunction with the v2 API to be able to form a valid submission?

Thanks again and especially for the fast response!

Hi @justinsven, for the global server, you need to use the link KoBoCAT REST API . The kc-eu.kobotoolboz.org is for the european server.

1 Like

Got it, thanks @osmanburcu!

2 Likes

@osmanburcu, :bowing_man: