cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1383
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Hiroki Aramaki on 26-01-2012 06:06:57 AM
Hi,
 
Refer to WebEx Social API document I send GET http://serverip/api/WebEx Social/rest/users/@me request to WebEx Social 2.5.2 server with basic authentication. WebEx Social response is 500 internal server error.
 
If I send  GET http://serverip/api/WebEx Social/rest, 200 OK responese.
 
Why WebEx Social response 500 internal error ?
Is there any requrement for REST API ?
 
Regards,
Hiroki Aramaki
 

Subject: RE: 500 Internal server error response
Replied by: Amanda Whaley on 16-02-2012 11:49:56 AM
You need to use OAuth Authentication to call the REST apis.  Please refer to the Authentication Section of the WebEx Social API Reference.

Thanks,
Amanda Whaley

Subject: RE: 500 Internal server error response
Replied by: Ben Sunderland on 15-03-2012 01:40:07 AM
Hiroki,

I have been through this, the docco misses some ket points. The summary if you use xAuth as I did is :

  A one time call (using basic auth header ) creates the API consumer for your app.
  Then the returned consumer details (key and secret) can be used by your app for its lifetime to get tokens.
 
  Each time you call the API, you need to use a valid token. So at the start of each session, you use the consumer details to get a valid token.
  The token only lasts 15 mins or so and then you'll need to refresh (see guide).
 
  Once you have a token you can use that to make API calls, and then get JSON / XML responses back from WebEx Social.


One thing not clear in the doc is the need to add a basic auth header (google it) to be able to register an api consumer:

E.g. to register you need to add a basic auth http header to get the keys back from WebEx Social:-

  function make_base_auth(user, password)
{
  var hash = Base64.encode(user + ':' + password);
  return "Basic " + hash;
}



function registerAPIcons()
{
  auth = make_base_auth($("#adminuser").val(),$("#adminpwd").val());
                 WebEx SocialURL = "http://WebEx Social.abc.com";
  var xhr = new XMLHttpRequest();
  var path=WebEx SocialURL+"/api/WebEx Social/rest/management/apiconsumers/";
  var params = "<apiconsumer><description>My App Desc</description><name>My App</name></apiconsumer>";

  xhr.onreadystatechange=function () {state_change(xhr); };
  xhr.open("POST", path, true);

  xhr.setRequestHeader("Content-Type","application/xml");
  xhr.setRequestHeader("Accept",getContentType());
  xhr.setRequestHeader("Authorization",  auth);

  xhr.send(params);

}
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links