Testing webhooks
Sending a standalone document
The Stonal plateform is centered arround assets. For the smartdoc product, we also require a documentation.
We recently started to offer a "disconnected" mode where you can skip these requirements to simply send documents, retrieve some core information around them and do the linking to assets and documentations later.
This is how you can do it:
- You declare a
STONAL_TOKEN
environment variable fetched from the Personal Access Tokens management page.
Declaring a token
export STONAL_TOKEN="<your_token>"
- You create a manifest file declare the file you want to send as "disconnected":
Creating a manifest
echo '{"disconnected": true}' > manifest.json
- You send the file to the
/upload
endpoint:
Sending the file
curl https://api.stonal-dev.io/document-storage/public/organizations/DEMO/files/upload \
-H "Authorization: Bearer $STONAL_PAT" \
-F 'manifest=@manifest.json;type=application/json' \
-F 'file=@sample.pdf'
- You get a response similar to this:
Server response
{"documentId":"efb614e6-f1b9-4829-acc4-2c8e26ab909a","duplicateDocumentIds":["434f3154-3c55-4c6f-a759-6de762251ab0"]}
If you have some values within the duplicateDocumentIds
array, it means that another document with the same content
already exists within the organization. This is not of any concern, you can safely ignore this.