I am trying to curl the URL to get the submitted data from the kobo to our server, I am facing the server issue; 502 Bad Gateaway

I am still facing the same issue? how do I solve this?

I am trying to curl the URL to get the submitted data from the kobo to our server, I am facing the server issue; 502 Bad Gateaway
URL: https://kc.humanitarianresponse.info/api/v1/data/XXXXX?format=json&sort={“_id”:1}&limit=1000&start=2500
Platform Use to fetch: Postman with Authorization header Token

I can access those data the day before yesterday but now. Please help me?

username: dhangadhimun

Welcome to the community, @sanjayadh! Have you had a look at our post discussed previously? It should help you with your issue:

Thanks for the quick respond Kal_lam.

How do I get ASSET_UID from kobo project?

This support article Using the API should be able to guide you on API.

I still face the same issues using v2 API to fetch the data. Please help @Kal_Lam

This indeed sounds fairly similar to what I had experienced.

In our case, we found that the server tended to be more loaded during daytime (in Europe and Africa, that is) and less at night. I’d recommend retrying your download at various times during the day. I had also experimented with different values for the start and limit parameters, but found that they did not have a consistent effect.

I’m adding a link to the download script that we’ve used, for reference. My guess is that it would be relatively easy to adjust that to add retries and the like.

1 Like

Hi @sanjayadh, based on the time it took for your request, your project may have a large number of submissions in which case @Sjlver is correct, sometimes this can fail based on server load and/or some issues with database efficiency that we’re currently addressing. Likely setting a limit in your URL will solve the issue (but might not as seen here: Cannot export and download my data):

"https://KF_URL/api/v2/assets/ASSET_UID/data/?limit=1000&format=json"
1 Like