Results 1 to 5 of 5

Thread: Rest API : problems with 6.2 and 6.3

  1. #1
    bluquet is offline Member
    Join Date
    Mar 2009
    Location
    France
    Posts
    7

    Default Rest API : problems with 6.2 and 6.3

    Hi,

    We've been using REST API without problem in versions 6.0 and 6.1.

    With 6.2 and 6.3, our queries with get_entry_list do not work and return "Invalid Session".
    In the error log, we find :
    [error] [client 127.0.0.1] PHP Warning: Missing argument 2 for SugarWebServiceImpl::get_entry_list() ...
    [error] [client 127.0.0.1] PHP Warning: Missing argument 3 for SugarWebServiceImpl::get_entry_list() ...

    we have not changed our code.
    Here is our query:
    input_type JSON
    method get_entry_list
    response_type JSON
    rest_data {"session":"lu98usd4g99g143d0ejd4bdfo7","module_na me":"Contacts","query":" contacts.assigned_user_id = 'seed_max_id'","order_by":"last_name","offset":0," select_fields":["first_name","last_name","account_name","title "],"link_name_to_fields_array":["name":"accounts_contacts","value":["id","name"]],"max_results":20,"deleted":0}

    Did any thing change in the API?

    Thanks in advance

  2. #2
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Rest API : problems with 6.2 and 6.3

    Quote Originally Posted by bluquet View Post
    Hi,

    We've been using REST API without problem in versions 6.0 and 6.1.

    With 6.2 and 6.3, our queries with get_entry_list do not work and return "Invalid Session".
    In the error log, we find :
    [error] [client 127.0.0.1] PHP Warning: Missing argument 2 for SugarWebServiceImpl::get_entry_list() ...
    [error] [client 127.0.0.1] PHP Warning: Missing argument 3 for SugarWebServiceImpl::get_entry_list() ...

    we have not changed our code.
    Here is our query:
    input_type JSON
    method get_entry_list
    response_type JSON
    rest_data {"session":"lu98usd4g99g143d0ejd4bdfo7","module_na me":"Contacts","query":" contacts.assigned_user_id = 'seed_max_id'","order_by":"last_name","offset":0," select_fields":["first_name","last_name","account_name","title "],"link_name_to_fields_array":["name":"accounts_contacts","value":["id","name"]],"max_results":20,"deleted":0}

    Did any thing change in the API?

    Thanks in advance
    Which REST entrypoint are you using?
    John Mertic
    Sugar Community Manager

  3. #3
    gerryka is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Default Re: Rest API : problems with 6.2 and 6.3

    Hello,

    today I tried to move my mobile Sugar application over from 5.5.4 to 6.2 and now have exactly the same problem.
    Has anyone of you found a solution yet?

    I have tried using all the available entry-points /service/v2/rest.php up to /service/v4/rest.php but get exactly the same error as bluquet.

    Thanks in advance
    Gerry

  4. #4
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    2,224

    Default Re: Rest API : problems with 6.2 and 6.3

    Quote Originally Posted by gerryka View Post
    Hello,

    today I tried to move my mobile Sugar application over from 5.5.4 to 6.2 and now have exactly the same problem.
    Has anyone of you found a solution yet?

    I have tried using all the available entry-points /service/v2/rest.php up to /service/v4/rest.php but get exactly the same error as bluquet.

    Thanks in advance
    Gerry
    Could you show me your code and I can try to help.

    Thanks!
    John Mertic
    Sugar Community Manager

  5. #5
    gerryka is offline Junior Member
    Join Date
    Oct 2010
    Posts
    2

    Default Re: Rest API : problems with 6.2 and 6.3

    I construct my REST calls in Obj-C (for iOS), using a library called ASIHTTPRequest. So far i had no problems merging all required strings and getting a valid JSON element, which i then send in the POST request.

    All I currently try to send is the following:

    Code:
    [request setPostValue:@"get_entry_list" forKey:@"method"];
    [request setPostValue:@"JSON" forKey:@"input_type"];
    [request setPostValue:@"JSON" forKey:@"response_type"];
    [request setPostValue:jsonData forKey:@"rest_data"];
    The jsonData variable contains the JSON formatted string, which, when logged on the server side, equates to the following:

    Code:
    {"session":"829d471340d621dbd3858ebaf7890f78","module_name":"Accounts","query":"accounts.assigned_user_id = '1'","order_by":"name","limit":"0","select_fields":{"["name","billing_address_city","billing_address_country"]"}}
    I already tracked the data through the PHP files of the Sugar Rest Service, it definitely gets send over, but is then lost somewhere before the get_entry_list function of the SugarWebServiceImpl gets called.

    The main thing I don't get is, what might have changed between version 5.5 and 6.2?

    Thanks for your time!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Rest API : problems with 6.2 and 6.3
    By bluquet in forum Developer Tools
    Replies: 1
    Last Post: 2012-01-26, 11:14 AM
  2. Rest API and Actionscript 3 example
    By undercoder in forum Developer Help
    Replies: 0
    Last Post: 2011-06-14, 09:30 AM
  3. REST and JSONP
    By AndyMain in forum Developer Help
    Replies: 2
    Last Post: 2011-05-26, 10:13 AM
  4. Using REST
    By bazdgs in forum Developer Help
    Replies: 1
    Last Post: 2011-03-21, 09:08 AM
  5. Rest in C#
    By geraldclark in forum Developer Help
    Replies: 8
    Last Post: 2010-10-26, 02:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •