cancel
Showing results for 
Search instead for 
Did you mean: 

Including a documents extra metadata in the API response

Chris_McKinnel
Champ on-the-rise
Champ on-the-rise

I've successfully installed the example package from this recipe in the dev cookbook and now I want the extra meta data field that is defined in the section "Extension of meta data" to appear in the JSON response when I hit /id/{docId}/ from the API.

At the moment I only seem to be getting the standard JSON response:

{
  "entity-type": "document",
  "repository": "default",
  "uid": "ca7362a7-0645-4887-a8af-c98e956bb87e",
  "path": "/default-domain/workspaces/Test workspace/Some thing/Untitled.1400776750970/Untitled/Untitled",
  "type": "DevCookbookExamplePapProcessRequestForm",
  "state": "undefined",
  "versionLabel": "1.0",
  "isCheckedOut": false,
  "title": "customer_form",
  "lastModified": "2014-05-22T16:48:54.00Z",
  "facets": [
    "Versionable"
  ],
  "changeToken": "1400777334000",
  "contextParameters": {}
}

Do I need to extend the API somehow to tell Nuxeo to include the vehicle_type in the JSON response?

1 REPLY 1

Damien_Metzler
Star Contributor
Star Contributor

Hello, sorry for the late answer. But you just have to add the X-NXDocumentProperties header and fill it with a coma separated list of the schema you want to include in the response.