REST API error nos doc type specified

Hi There,

I'm trying to test a simple rest call trough the console (firebug in firefox) on nuxeo 5.9.1 (I'm logged in)

jQuery.ajax({
    type: 'POST',
    url: '/nuxeo/api/v1/path/default-domain',
    data:{"entity-type": "document", "name":"docje", "type": "File","properties": { "dc:title": "docje", "dc:description": "Created via a so cool and simple REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null}}
});

But I get an 500 internal server error: Nos doc type specified.

Am I doing something wrong?

Thanks, Bauke

0 votes

1 answers

1832 views

ANSWER



Already fixed it

jQuery.ajax({
    type: 'post',
    url: '/nuxeo/api/v1/path/default-domain',
    data:'{"entity-type": "document", "name":"docje", "type": "File","properties": { "dc:title": "docje", "dc:description": "Created via a so cool and simple REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null}}',
    contentType: "application/json; charset=utf-8",
    dataType: "json"
});

I missed the content and data type. -_-

1 votes