Upload Document

Upload Document to Workspace

Upload Document

POST https://app.sagexglobal.ai/api/document/upload

This is HTTPS Post method to upload the pdf document to be uploaded to your Account Workspace

Authorization

Bearer Token : <API key>

The client must send this API Key in the Authorization header when making requests to protected resources

Request Body

Name
Type
Description

file*

file

/path/file.pdf

realm_guid*

Text

Your account realm id

workspace_guid*

Text

Your account workspace id

document_name*

Text

Name of the document

document_fields

JSON Object

Refer below for details on JSON Object

//Sample Response Body
{
    "data": {
        "realm_guid": "NN",
        "workspace_guid": "xxxxxx-c160-11ed-xxxxx-xxxxxxx",
        "document_guid": "xxxx-068f-xxxx-xxxx-xxxxxxx"
    },
    "message": "success",
    "status": "success",
    "code": 200
}
// document_fields - JSON Object
{ 
    "country" :"<iso country code>",
    "language": "<iso language code>",
    "document_ref": "<client generated unique document id>",
    "publishing_year": "<year of publishing the document>",
    "publisher_name": "<name of entity/person/business publishing the document>",
    "document_type": "<document type defined by organization>"
}	

Take a look at how you might call this method using curl:

curl -X POST 'https://app.sagexglobal.ai/api/document/upload' \
--form 'file=@"/path/file.pdf"' \
--form 'realm_guid="<realm_id>"' \
--form 'workspace_guid="<workspace_id>"' \
--form 'document_name="<document_name>"' \
--form 'document_fields="{
    \"country\": \"IND\",
    \"language\": \"En\"
}"'
-H "Authorization: Bearer <API Key>"

Last updated