08-31-2017 07:43 AM
For create file using Rest API (Nuxeo Platform 8.10 ), Postman I follow this link "https://doc.nuxeo.com/nxdoc/document-resources-endpoints/"
POST http://NUXEO_SERVER/nuxeo/api/v1/id/{idOfParentDoc}
{
"entity-type": "document",
"name":"newDoc",
"type": "File",
"properties": {
"dc:title": "The new document",
"dc:description": "Created via a very cool and easy REST API",
"common:icon": "/icons/file.gif",
"common:icon-expanded": null,
"common:size": null
}
}
But I am getting 500 exception – “invalid argument exception. No doc type specified” as Response. How to resolve this issue .
08-31-2017 09:27 AM
Hi Amel,
I just did the test on a 8.10 with postman too and it seems to works. What I tested:
POST http://localhost:8080/nuxeo/api/v1/path//
{
"entity-type": "document",
"name":"newDoc",
"type": "File",
"properties": {
"dc:title": "The new document",
"dc:description": "Created via a very cool and easy REST API",
"common:icon": "/icons/file.gif",
"common:icon-expanded": null,
"common:size": null
}
}
I get the response:
{
"entity-type": "document",
"repository": "default",
"uid": "34fb78e7-a114-4ad2-85ee-790200a6b60d",
"path": "/newDoc",
"type": "File",
"state": "project",
"parentRef": "dfc52762-a3dd-43df-9a8a-deebfec8a0ee",
"isCheckedOut": true,
"isVersion": false,
"isProxy": false,
"changeToken": "1504185758833",
"title": "The new document",
"lastModified": "2017-08-31T13:22:38.833Z",
"facets": [
"Versionable",
"Publishable",
"Commentable",
"HasRelatedText",
"Downloadable"
]
}
Same thing with the id
url:
POST http://localhost:8080/nuxeo/api/v1/id/dfc52762-a3dd-43df-9a8a-deebfec8a0ee
{
"entity-type": "document",
"name":"newNewDoc",
"type": "File",
"properties": {
"dc:title": "The new document",
"dc:description": "Created via a very cool and easy REST API",
"common:icon": "/icons/file.gif",
"common:icon-expanded": null,
"common:size": null
}
}
I get the response:
{
"entity-type": "document",
"repository": "default",
"uid": "3cd23391-f419-4a37-97db-b9215b26f4fc",
"path": "/newNewDoc",
"type": "File",
"state": "project",
"parentRef": "dfc52762-a3dd-43df-9a8a-deebfec8a0ee",
"isCheckedOut": true,
"isVersion": false,
"isProxy": false,
"changeToken": "1504185958567",
"title": "The new document",
"lastModified": "2017-08-31T13:25:58.567Z",
"facets": [
"Versionable",
"Publishable",
"Commentable",
"HasRelatedText",
"Downloadable"
]
}
Note dfc52762-a3dd-43df-9a8a-deebfec8a0ee
is the id of my Root document.
08-31-2017 10:24 AM
Hi Kevin ! Thank you for your reply. I repeat the test with your example :
POST http://localhost:8080/nuxeo/api/v1/id/094a6c81-891c-4a0f-9eec-8dbde7fdb85d { "entity-type": "document", "name":"newNewDoc", "type": "File", "properties": { "dc:title": "The new document", "dc:description": "Created via a very cool and easy REST API", "common:icon": "/icons/file.gif", "common:icon-expanded": null, "common:size": null } }
But I get the same error : 500 exception – “invalid argument exception. No doc type specified” as Response. How to resolve this issue . I don't understand what is the problem!
08-31-2017 11:52 AM
Which body type do you use ? Which http headers do you provide ?
08-31-2017 12:31 PM
form-data for the body type.
08-31-2017 04:02 PM
You can use raw with Content-Type application/json
09-04-2017 04:24 AM
it works well!! thank you Kevin
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.