tags:

views:

14

answers:

2

I need to be able to use the API for SugarCRM to exchange information with several other applications. I found the api docs, and some good articles with sample code. The end result of my code is to send this command:

http://localhost/sugarcrm/service/v2/rest.php?method=login&input_type=json&response_type=json&rest_data={%22user_name%22:%22rest%22,%22password%22:%2265e8800b5c6800aad896f888b2a62afc%22,%22version%22:%22.01%22}

Which produces this error {"name":"Invalid Login","number":10,"description":"Login attempt failed please check the username and password"}null

I have googled the error and found several others with this issue, but no solution.

A: 

I think the proper REST string would be like:

method=login&input_type=json&response_type=json&rest_data={"user_auth": {"user_name":"user","password":"somemd5hash","version":"1.0"},"application_name":"RestTest"}

(should be url-encoded then of course)

StasM