Announcement

Collapse
No announcement yet.

Error Message - JAVA - HttpClient

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error Message - JAVA - HttpClient

    Hi, I've got an error when i execute a put method in JAVA with an HttpClient :

    For the module contacts, i want to know informations about only one contact, so i use the action "all" and i send my request with "/contacts?action=all&session=my_session_id&columns= list_of_id_of_requested_columns_informations"
    and in the RequestEntity (cause the RequestBody is deprecated) i send a JSONObject with the "id" of the requested contact and the "folder" containing the contact.

    And this is the response i receive :

    "{"category":8,"error_params":["folder"],"error":"Missing the following field: %s","error_id":"-177590921-673","code":"SVL-0002"}"

    I really don't understand what is the problem

    Thanks for every help

    Espionnite

  • #2
    1. The error message means you must specify a "folder" parameter in the URL.
    2. You are using the wrong request. "action=all" means "all objects in a folder". What you want is either "action=get" or "action=list".
    3. With "action=get", the folder is also required in the URL. The Wiki just got updated. (Some modules currently work without the folder ID, but the HTTP API is supposed to require it.)
    4. With "action=list", the folder is included for each object in the request entity. "Object ID" there is defined as a JSON object with the fields "id", "folder" and maybe others (e. g. for appointment sequencies).

    Comment


    • #3
      Oh yes yes i wanted to say action "list" sorry, I use action "list"
      But my problem still here, and in the JSONObject I send, there is the id of the contact and the id on it's parent folder...hum

      Comment


      • #4
        Could you post the JSON object which you send?

        Comment


        • #5
          Okay I'm sorry i made a little mistake !
          I made 2 JSONObjects in the to send Array, but in fact we need only one !

          that's the good version :

          //the to send array
          JSONArray jsona = new JSONArray();

          //The JSONObject containing the fields "id" and "folder"
          JSONObject jsono = new JSONObject();
          jsono.put("id",10);
          jsono.put("folder",46);

          //The object in the array
          jsona.put(jsono);

          //And you send the array by the RequestEntity

          Thanks a lot for your help !!
          Espionnite
          Last edited by Guest; 03-18-2008, 04:26 PM.

          Comment

          Working...
          X