Using the Web Services API

I am trying to use the web services API, but I'm running into an issue. I've found that if I log into SageCRM and have an active session, then the API works fine. However, if I do not have an active session and I try to connect the the web service API, then instead of returning an XML response, the following text is instead returned:

"<script type="text/javascript" src="../../cookie.js"></script><script language="Javascript"> Cookies.create("setyourcountry","northamerica",365); Cookiesloc.create("setregion","na",365); Cookieslang.create("setlang","en",365); </script><form action='na.sagecrm.com/.../' method='post' name='logon'><input type='hidden' name='country' value='northamerica'></form><script language="JavaScript">document.logon.submit();</script>"

It appears to be running JavaScript to log me in, but obviously this will not work with a web service connection.

  • 0

    Can I confirm that you are using the cloud edition? Are you authenticating the user with the web services API or are you reusing a session I'd from someone who has logged on through the main interface?

  • 0

    I am using the cloud edition, yes. I am attempting to authenticate the user via the web services API by passing the following XML:

    myusername

    mypassword

    This information is being passed via Java code, so there is no session data being preserved or passed. If I am logged into Sage CRM in a browser then this code works fine, but if not, then it returned the HTML I mentioned earlier.