geonode.documents.api.views
Attributes
Classes
API endpoint that allows documents to be viewed or edited. |
Module Contents
- class geonode.documents.api.views.DocumentViewSet[source]
Bases:
dynamic_rest.viewsets.DynamicModelViewSetAPI endpoint that allows documents to be viewed or edited.
- perform_create(serializer)[source]
Function to create document via API v2. file_path: path to the file doc_file: the open file
The API expect this kind of JSON:
{ "document": { "title": "New document", "metadata_only": true, "file_path": "/home/mattia/example.json" } }
File path rappresent the filepath where the file to upload is saved.
or can be also a form-data:
curl --location --request POST 'http://localhost:8000/api/v2/documents' \ --form 'title="Super Title2"' \ --form 'doc_file=@"/C:/Users/user/Pictures/BcMc-a6T9IM.jpg"' \ --form 'metadata_only="False"'