Kobo api without attachment

Hello there i have a problem when i call api for getting data it’s taking to long time to response.
note every submission have attachment in this form. is there any option to call api without api Please me know
this is my api

string api_call = “https://kc.humanitarianresponse.info/api/v1/data/…?format=json”;

            using (var request = new HttpRequestMessage(new HttpMethod("GET"), api_call))
            {
                var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes("user:pass"));
                request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
                HttpClient client = new HttpClient();
                client.Timeout = TimeSpan.FromMinutes(15);
                var response = await client.SendAsync(request);
                var bytes = await response.Content.ReadAsByteArrayAsync();
                Encoding encoding = Encoding.GetEncoding("utf-8");
                string the_response = encoding.GetString(bytes, 0, bytes.Length);
               
            }

@Kal_Lam brother any help for me please

1 Like

Pinging in @Josh for this issue.

thank you @Kal_Lam
i am waiting for @Josh
@stephanealoo any solution for me
or if there any like as only selected column will return.

thanks again

1 Like

Hi @mizanvai, sorry for the late response. You can try doing something like

# Using /api/v2
curl -X GET 'https://[kpi]/api/v2/assets/{asset_uid}/data/?fields=["field_1", "field_2"]&format=json'

# Using /api/v1
curl -X GET 'https://[kc]/api/v1/data/{id}/?fields=["field_1", "field_2"]&format=json'

There’s no parameter to exclude a field, so you will just have to list all the fields you want, excluding the ones you don’t.

Hope that helps.

2 Likes

thank you @Josh && @Kal_Lam

1 Like