Announcement

Collapse
No announcement yet.

Updating appointment fails (Java)

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

  • 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
    Solved

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



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

    Comment


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

      Comment


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

        Comment

        Working...
        X