xxx of yyy characters
Join Group

Hi5 Platform Development

Google Translation: Off

When Google Translation is on, topics and messages in this group will be machine-translated to your language by Google.

Messages


Topic: About currently Userid
I'm developing my app now,and use REST api mode, but i can't find which api can get current userid (current viewer).
what shall i do?

best regard.
Jackie.
Nov 5
4:17 AM

Posted by 健佳 郝

Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  
Use makeRequest in gadget.xml to call a page of yours, you'll have the current userid in the request params:

var params = {};
params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.SIGNED;
params["OAUTH_SERVICE_NAME"] = "HMAC"; //This is the critical part which forces the use of HMAC
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;

var url = document.getElementById('url').value + "?container_view=" + gadgets.views.getCurrentView().getName();
gadgets.io.makeRequest(url, showResponse, params);
Nov 11
6:29 AM


Note: To add an image or link in your message, use <img src="http://www.hi5.com/example.jpg"> or <a href="http://www.hi5.com/example.html">Text </a>

 
 

  

Title
body
 

Purchase additional coins

You need an additional: hi5 Coins hi5 Coins

Get Coins No Thanks