Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    3

    Default Updating appointment fails (Java)

    Hello

    I've a problem to update an appointment.

    The part of the code :

    //-------------------------------------------------------------------------

    Code:
    JSONObject jobj = new JSONObject();
    jobj.put("id", 5);
    
    // only in case 1
    jobj.put("session", "9c262715217e4a89a039324e2b58be64");
    //
    
    jobj.put("timestamp", 1309341706969);
    jobj.put("folder", 209);
    jobj.put("note","Updated note");
    
    StringEntity entity = new StringEntity(jobj.toString());
    HttpPut put = new HttpPut(oxSession.getCommandAndQuery(false));
    put.setEntity(entity);
    HttpResponse response = this.httpClient.execute(put);
    HttpEntity resEntity = response.getEntity();
    String result = EntityUtils.toString(resEntity);
    .... 
    parse results.....
    //-------------------------------------------------------------------------

    And the result

    Code:
    Case 1 :
    URI
    http://OXSERVER/ajax/calendar?action=update
    Params in PUT request
    {"folder":209,"timestamp":1309341706969,"id":5,"session":"9c262715217e4a89a039324e2b58be64"}
    
    Result :
    {"code":"SES-0201","error_id":"2000700810-158","category":8,"error_params":[],"error":"The session parameter is missing."}
    Code:
    Case 2 :
    URI
    http://OXSERVER/ajax/calendar?action=update&session=5d97857987b54a4287818db97745f68e
    Params in PUT request
    {"folder":209,"timestamp":1309341706969,"id":5}
    
    Result :
    {"code":"SVL-0002","error_id":"2000700810-147","category":8,"error_params":["id"],"error":"Missing the following request parameter: %s"}
    Any ideas? And of course...thank's in advance

    Elias

  2. #2
    Join Date
    Jun 2011
    Posts
    3

    Default

    Solved

    My fault was to NOT put all params into the query :

    http://OXSERVER/ajax/calendar?action...818db97745f68e

    The rest of data fills now the entity (start_date, end_date, note or others)

  3. #3
    Join Date
    Feb 2007
    Posts
    251

    Default

    The parameters described in the HTTP API are all URL parameters. The PUT body is described in the paragraph starting with "Request body:".

  4. #4
    Join Date
    Jun 2011
    Posts
    3

    Default

    Thanks for your response. Yes, I solved this last week I wrote a "Solved" post with code corrections, but it doesn't appear here

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
  •