How to get the widget data using rest api or some other ways in ESB6.5? - wso2

I want use another dashboard project based on Javascript to show data ,but I don`t know how to get the Statistical data. Is there any api or some way to get the data?

It would be better if you can share what kind of data do you want to portrait in your dashboard. Anyhow you can use the admin services available in ESB 6.5 to get the available data.
https://docs.wso2.com/display/EI650/Working+with+Admin+Services

Related

access Restful API data in jsreport templates

I am using loopback API to get data in JSReport
I want to draw DC charts using templates and I need Recipe html of jsreport, so that I can embed it in my dashboard graphs. API for a jsreport can be different every time. i.e. at runtime we don't know the properties of over API, so how can I bind this API data with DC charts in jsreport template with 'html'
I was facing almost same problem and I was also using loopback.
The following link gives you solution for this problem
link
Also you can ask your problems on Active google group too.
Google group for jsreport

Displaying my own analytics data to unauthenticated users

I am writing this question after considerable investigation into this matter.
I have gone through Google's easy dashboards (gadash JS library), superProxy and plain analytics API, and couldn't find the best solution for my needs, although I can't believe my needs are so uncommon.
This is why I am turning to you, I have got a feeling I am missing something.
My requirement:
Display my own analytics account data to users on my website, preferably with Google's chart API or ga-dash, to resemble google analytics views as much as possible.
Users will not have to take part in authentication with Google API
Each user has his own query which is built dynamically !! (this is probably why superProxy cannot work for me because I think you need to manually set the queries in advance)
I use django-python as the basis for my website
problems with solutions I tried:
GAdash library - the problem is that each user has to be authenticated, and shown their own data, meaning they need access to my profile- that's simply not what I am looking for. It works great, but only for me. On the other hand if there was a way to make my profile truly public...
superProxy - sounds like a solution for this need exactly, however I don't think that you can programmatically set the queries.
I did find a way to retrieve the data for a query on the server side using my own credential which is a bit hacky, I am still missing that JS library which will parse this XML on the client side and display it as charts.
EDIT:
I ended up using Mark's solution (embeddedanalytics), since I could not find a better, easier solution.
Other alternatives were:
1. superProxy (lacking the ability to dynamically, programmatically loading new queries)
2. gaDash library - requires authentication from each user
3. Implement my own server side querying, and display to the user with some js graphics library - which would require considerable work on my side.
Check out www.embeddedanalytics.com. This is a platform/service which will do exactly what you are looking to do (disclosure - I work with them).
We also support your requirement that each user have its own dynamically built query. This is what we call our CMS Integration version. Are you trying to create a dashboard system for a CMS system you have built?

Using Django with the Facebook API for a polling app

I randomly pick two friends of the user and ask him/her to pick who is the better friend. Now all I have is the friend ID which I then have to use to create a poll and store in the database accordingly. Using the Facebook graph API, I have the ID. All I need to do now is to pass it to Django.
I'm new to this so how exactly would I do that? Pass a javascript variable to Django?
I see two options.
At client side using Javascript SDK,
Fetch the friends' profile details along with ID.
Convert them to JSON.
Do a POST request to a django url/view which stores the data in database.
In this way, you don't need to do any graph API queries further from server side. But this won't help you updating the data at realtime. Consider, if one of the friends changing his name in FB, now what is stored in your database becomes obsolete. So, you need to make sure that some thing from client side implemented to do real time update posts to server side.
At server side using any django facebook graph API apps,
Get the IDs from client side.
Use the fb graph app to fetch the details at server side.
Store them in database.
In this way, you could be able to schedule a callback for real time updates. I prefer the second approach as it's always better to burden the server rather than client. And I found this app simple and do what you need. https://pypi.python.org/pypi/django-facebook-api/0.1.10

Displaying Own Data Using OAuth2 and Google APIs with No Login

I am trying to build an application with ColdFusion.
I've been reading documentation and trying things out for days and for the life of my I can't seem to figure out how to display my own data to users from Google's APIs using OAuth2.
For example, I want to be able to display some of my stats to users with the Google Analytics API. How many unique hits, page views my site gets and from what countries. The data is private, however, so there isn't a way to do so. Or YouTube just changed their API so video tags can no longer be seen unless logged in. I want to be able to show my video tags so they can search for related things on my own site, but I can't pull them because I'm unsure of how to do this.
I know how to display and manipulate public data, but when it comes to private data, I'm at a complete loss. OAuth2 is kicking my butt!
Is there anybody that can please, please help me with OAuth2 so that I can allow my users to see my private Google data without there being any kind of log in process for them? Examples using ColdFusion would be so much appreciated.
The answer is more or less what I said at How to retrieve my own private playlist through YouTube API?
You'd want to use the OAuth 2 for Installed Applications flow, and generate new access tokens via your refresh token when your old access token expires. I'm not familiar with any libraries for doing OAuth 2 in Cold Fusion, though.

HTML5 Canvas to Facebook

I've made a basic HTML5/JS comic creation tool that uses the canvas element.
I want users to be able to upload their comics via the Facebook API.
I don't believe Facebook allows posting images in the form of base64 strings from the canvas.toDataURI() method, and don't want to use my own server to convert these images & temporarily store them.
What's the best way to go about this? Possibilities I've wondered about: Convert canvas to blob? Store blob via web service (if so, suggestions?) Upload blob directly to Facebook? (Is that possible?)
I don’t see why this should not be possible doing a „normal” upload. You can create a new photo for a user by posting to PROFILE_ID/photos, with a source parameter of type multipart/form-data.
So first thing I’d try is getting the picture info from the canvas object into a „normal” form (writing it into a input element in the right format(?)), and sending that to Facebook. If this step succeeds, I’d see if jQuery or some other lib’s form.serialize method can build requests of type multipart/form-data. If that’s also possible, then there should be no further problem in taking the data in that format and posting it using FB.api (although you might want to tell your users to be patient, because that might take a while).
Can’t tell for sure if this’ll work, but I’d give it a try.
Facebook partners with Heroku for free app hosting, you can use it as the temporary server.