Titanium JIRA Archive
Appcelerator Community (AC)

[AC-4717] create objects rest api call fails

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2017-01-11T16:25:00.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsArrowDB
Labelsn/a
Reporterheedoo moon
AssigneeShak Hossain
Created2017-01-07T18:22:13.000+0000
Updated2017-01-11T16:25:00.000+0000

Description

I sent below data for creating custom object but it returned "Missing FIelds" error callback. Method : "POST" URL : https://api.cloud.appcelerator.com/v1/objects/announcement/create.json?&key=MY_KEY&_session_id=MY_SESSION_ID&pretty_json=true Params : {"fields": {"title":"aa","description":"bb"}} I followed rest api syntax from this link "http://docs.appcelerator.com/arrowdb/latest/#!/api/CustomObjects-method-create"

Comments

  1. Sharif AbuDarda 2017-01-10

    Hello, Can you share the full curl command you are running for creating objects. The usual command is like
       $ curl -b cookies.txt -c cookies.txt -F "fields={\"color\":\"blue\", \"make\": \"nissan\", \"purchased_at\" : \"2011-11-02 17:07:37 -0700\", \"year\" : 2005, \"used\" : false, \"coordinates\":[-122.1, 37.1]}"  https://api.cloud.appcelerator.com/v1/objects/car/create.json?key=<;YOUR APP APP KEY>&pretty_json=true
       
    Also, send the error log. Thanks.
  2. heedoo moon 2017-01-10

    Hi Sharif, I tested with Postman not curl command and this is error log. { "meta": { "status": "fail", "code": 400, "message": "Missing fields", "method_name": "createObject" } } Are you able to get data?
  3. heedoo moon 2017-01-11

    Never mind. I found that arrowdb rest api requires to pass all data as in url instead of body. example) method : POST url : https://api.cloud.appcelerator.com/v1/objects/announcement/create.json?&key=MY_KEY&_session_id=MY_SESSION_ID&fields='{"title\":"aa","description":"bb"}'&pretty_json=true

JSON Source