GET data from API ona.io

355 views
Skip to first unread message

Rido

unread,
Feb 8, 2016, 9:09:24 PM2/8/16
to Ona Community
I want to show data from "ona.io" on my web page . I am still confused on how to use the data retrieval API "ona.io" , I am very grateful if anyone give an example script for data retrieval, this is the address of my project "https://ona.io/itbnpb/11646"

Ridowan Nasution

unread,
Feb 10, 2016, 4:22:06 AM2/10/16
to Ona Community
Hi Roy,

I have problem token API from your example JS script


this image token API from https://api.ona.io/itbnpb/api-token




what there fault that I do?.

Sory i'm beginner about get data from API anything, because this my first myproject to get data from API ona.io. So, i am very grateful if you help me.

Regards,

Rido


2016-02-09 17:07 GMT+07:00 Ona Community <ona-co...@googlegroups.com>:
Hi Rido,

The API documentation will guide you on how to use the API. You'll need to be authenticated to be able to retrieve data for a private form. https://api.ona.io/static/docs/index.html#authentication. Here's documentaion on how to retrieve data https://api.ona.io/static/docs/data.html#get-submitted-data-for-a-specific-form

You can get an example JS script here https://github.com/ukanga/js-ona-api-demos.

Regards,

Roy.

--
Ona Support
ona-co...@googlegroups.com
{#HS:169175145-2101#}
On Tue, Feb 9, 2016 at 2:09 AM UTC, Rido <rido...@gmail.com> wrote:
I want to show data from "ona.io" on my web page . I am still confused on how to use the data retrieval API "ona.io" , I am very grateful if anyone give an example script for data retrieval, this is the address of my project "https://ona.io/itbnpb/11646"


--
Collect, Analyze and Share Data - https://ona.io/
---
You received this message because you are subscribed to the Google Groups "Ona Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ona-communit...@googlegroups.com.
To post to this group, send email to ona-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/ona-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/ona-community/ee33a4c1-c79f-4fcb-aafb-49505c2e19a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




Ridowan Nasution

unread,
Feb 12, 2016, 1:47:40 AM2/12/16
to Ona Community
Hi Roy

Thank you for his guide.

I have a problem, in the example application "js-ona-fire-demos-master", an array of detail described the "invalid token". whether there is a problem of API token's?




then I want to ask the documentation "https://api.ona.io/static/docs/data.html#get-submitted-data-for-a-specific-form". For example: how to know id project "pk" module dataviews?

I've been using the technique of curl through the "cmd" with the command "curl -X GET https://api.ona.io/api/v1/data", the results are not there with the name of my project or with source code php.
"
<?php

$ch = curl_init();

/*
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_USERAGENT => 'Test'));
*/

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);

$resp = curl_exec($ch);

print_r($resp);

curl_close($ch);

//var_dump(json_decode($resp,true));
?>
".


Regards

Rido

2016-02-11 14:52 GMT+07:00 Ona Community <ona-co...@googlegroups.com>:
Hi Rido,

Try running the application web server on port 3000 or port 8000 port, such that you access it on the brower using the url localhost:3000/json-ona-api-master/index.html or localhost:8000/json-ona-api-master/index.html

Or you could run the application using python's simple HTTP server as indicated here. https://github.com/ukanga/js-ona-api-demos/blob/master/README.md with ports 3000 or 8000.

We also have open source Ona API client library written in Clojure https://github.com/onaio/milia which you can

You could also use PHP cURL if you are familiar with PHP http://php.net/manual/en/curl.examples-basic.php or PycURL for http://pycurl.io/docs/latest/quickstart.html Python.


--
Ona Support
ona-co...@googlegroups.com
{#HS:169175145-2101#}
On Wed, Feb 10, 2016 at 9:22 AM UTC, Ridowan Nasution <rido...@gmail.com> wrote:
Hi Roy,

I have problem token API from your example JS script


this image token API from https://api.ona.io/itbnpb/api-token




what there fault that I do?.

Sory i'm beginner about get data from API anything, because this my first
myproject to get data from API ona.io. So, i am very grateful if you help
me.

Regards,

Rido


Files Attached: api-token-ona.jpg (22 KB)   error_ona_api.jpg (39 KB)  

Ridowan Nasution

unread,
Mar 2, 2016, 8:53:02 PM3/2/16
to Ona Community
Thanks you my support to me Roy.

I want to ask you back.

I am having trouble, to insert my photo to project private ONA, because before I used Humantarian to conduct a survey, the text data can already be moved, but the image data I can not move, how do it to move data my photos from Humantarian to my project ona.

then I want to configure the feature filter dataview, but the function was not in private, while in public projects such features exist and there is an error on my current configuration.

Private Project


Error Configuration in public project




Regards
Rido

2016-02-15 18:13 GMT+07:00 Ona Community <ona-co...@googlegroups.com>:
Hi Rido,

The token should just include a token as copied from Ona without a URL. Remove https/ona.io/itbnpb/ from the token string and try again. Hope this helps.


Regards,

Roy.

--
Ona Support
ona-co...@googlegroups.com
{#HS:169175145-2101#}
On Fri, Feb 12, 2016 at 6:47 AM UTC, Ridowan Nasution <rido...@gmail.com> wrote:
Hi Roy

Thank you for his guide.

I have a problem, in the example application "js-ona-fire-demos-master", an
array of detail described the "invalid token". whether there is a problem
of API token's?




File Attached: invalid token.jpg (45 KB)  



On Thu, Feb 11, 2016 at 7:52 AM UTC, Ona Community <ona-co...@googlegroups.com> wrote:
Hi Rido,

Try running the application web server on port 3000 or port 8000 port, such that you access it on the brower using the url localhost:3000/json-ona-api-master/index.html or localhost:8000/json-ona-api-master/index.html

Or you could run the application using python's simple HTTP server as indicated here. https://github.com/ukanga/js-ona-api-demos/blob/master/README.md with ports 3000 or 8000.

We also have open source Ona API client library written in Clojure https://github.com/onaio/milia which you can

You could also use PHP cURL if you are familiar with PHP http://php.net/manual/en/curl.examples-basic.php or PycURL for http://pycurl.io/docs/latest/quickstart.html Python.


--
Ona Support
ona-co...@googlegroups.com


Reply all
Reply to author
Forward
0 new messages