Adobe Connect User Community
Menu

#1 2009-04-29 02:31:25

**_netdiver_**

Problems with API Calls

Dear all,
I'm a new Connect Pro user, developer and admin!
I have a problem that seems to have been discussed in the forum but I can't find a solution.
The problem is that I can't go beyond login. I'm using POST calls.

Here are the calls and responses
1st CALL:

<params><param name="action">common-info</param></params>

1st RESPONSE:

<?xml version="1.0" encoding="utf-8"?>
<results>
   <status code="ok"/>
   <common locale="en" time-zone-id="85">
      <cookie>breez65wzkg284sc3na5f</cookie>
      <date>2009-04-29T07:12:40.693+00:00</date>
      <host>http://connect.xxxxx.xx</host>
      <local-host>connect</local-host>
      <admin-host>connect.xxxxx.xx</admin-host>
      <url>/api/xml</url>
      <version>connect_702_r32</version>
      <account account-id="7"/>
      <user-agent>Java/1.6.0_12</user-agent>
   </common>
</results>

2nd CALL (login):

<params>
  <param name="action">login</param>
  <param name="login">user@domain</param>
  <param name="password">averystrongpassword</param>
  <param name="session">breez65wzkg284sc3na5f</param>
</params>

2nd RESPONSE:

<?xml version="1.0" encoding="utf-8"?><results><status code="ok"/></results>

3rd CALL:

<params>
    <param name="action">principal-list</param>
    <param name="session">breez65wzkg284sc3na5f</param>
</params>

3rd RESPONSE:

<?xml version="1.0" encoding="utf-8"?>
<results><status code="no-access" subcode="no-login"/></results>

The status code of the 3rd response indicates that I am not logged in, but the login has been done just some milliseconds after!

Which is the problem? Why do this sequence is not working?
Thanks in advance for any help.
Regards from Lorenzo

Last edited by **_netdiver_** (2009-04-29 02:33:13)

Offline

#2 2009-04-29 09:13:10

**_AChemey_**

Re: Problems with API Calls

Lorenzo,

I'm wondering if perhaps your calls to the server weren't synchronous (the call for principal-list didn't happen after login)?!?  I just tried this test by manually calling the same API's in Flash (using AS2):

var sendPost:LoadVars = new LoadVars();
var receivePost:LoadVars = new LoadVars();

var url_str:String = "http://{CONNECTSERVER}/api/xml";

receivePost.onData = function(data)
{
    trace(data.toString());
}

common_btn.onRelease = function()
{
    sendPost.action = "common-info";
    sendPost.sendAndLoad(url_str, receivePost, 'POST');
}

login_btn.onRelease = function()
{
    sendPost.action = "login";
    sendPost.login = 'FredFlintstone@LearningConsulting.com';
    sendPost.password = 'FredFlintstone';
    sendPost.session = 'Sbreezxwb9ffcqa7nsav6h';
    sendPost.sendAndLoad(url_str, receivePost, 'POST');
}

principal_btn.onRelease = function()
{
    sendPost.action = 'principal-list';
    sendPost.session = 'Sbreezxwb9ffcqa7nsav6h';
    sendPost.sendAndLoad(url_str, receivePost, 'POST');
}

NOTE:  I grabbed the Session value by running it once and clicking the "common-info" button and then copy/paste (hardcoding) the return value for session into the login/principal calls.

This returned the data for me. 

Can you try something similar?

Regards,

Andrew

Offline

#3 2009-04-30 06:17:05

**_netdiver_**

Re: Problems with API Calls

Thank you Andrew for your reply.
Unfortunately I can't figure out what is going wrong yet.
I'm making the calls in the order I wrote, and I put a delay of 3 seconds before making the 3rd call.
I am sure login was ok, as of 2nd response, but every subsequent request (that needs logged in user session) fails.

I can't make a Flash application (I don't have flash); I'm working in Java, and I found the XMLApiAdapter.java provided by Adobe.
I tried to use it, instead of my methods, but this Adapter also fails, returning the same message:
<results><status code="no-access" subcode="no-login"/></results>

I tried also to make calls on the querystring and setting the cookie in the request header (instead of the POST XML method), without success.

The same calls made by a browser (after interactive login) in the querystring are succesful, without taking care of the cookie (I think the browser handles it correctly).

Next step: I'm trying to use HTTPClient from Apache.
I'll be back with results.
In the meantime I'm open to all suggestions.
Thanks in advance.
Lorenzo

Offline

#4 2009-05-05 04:58:47

**_netdiver_**

Re: Problems with API Calls

Ok, I sorted it out.
In the Connect Pro API guide (Using Adobe Acrobat Connect Pro 7 web services) it is asked to make a POST request sending an XML document to the Connect Pro API setting the Content-type as text/xml or application/xml (page 15 of the PDF).

I decided to not follow this directive and I started to send an urlencoded string formed as action=login&login=username&password=password as Content-type application/x-www-form-urlencoded and the subsequent "no-login" messages disappeared.

So if someone from Adobe is reading, I suggest them to check and modify the document :)

Regards! Lorenzo

Offline

#5 2009-05-19 17:36:24

**_sfsmithcha_**

Re: Problems with API Calls

Hi Lorenzo,

If you post as text/xml, you need to use cookie management library or pass back the breezesession in a "Cookie" header rather than sending it as a parameter.

HTH,

Charles

Offline

Board footer