URL Import
The url import allows users to import a document from a specified URL using the /v1/import/url
endpoint.
The payload is made up of the following elements:
Element | Description |
---|---|
correlationId | The unique identifier for the import. It is used to track the request through the system and is returned in the available webhooks. |
url | The URL of the file to be imported and reviewed. |
selectedOptionIds | The ID's of the Options to be used for the Review. The selectedOptionIds element is comprised of the desired Option ID's for the file. |
categorisationId | The ID of the Categorisation to be used for the Review. The categorisationId can be obtained by using the Categorisation Resource as outlined here. |
The document will then be available for review in the Red Marker platform after the file has been imported and processed.
Correlation ID
If one is not supplied, Red Marker will generate one included in the response that can be used to track the import.
Usually this is used to contain an external identifier for the file being imported.
Selected Option ID's
The system will convert the supplied Option ID's into a Categorisation automatically.
If you are using this element, you should not supply a categorisationId
as they represent the same data. So, you should use either the categorisationId
or the selectedOptionIds
elements to provide details about the file categories.
If you provide both categorisationId
and selectedOptionIds
a validation error will be returned.
You can obtain the ID by checking the "value" field of the Options in the Categorisation Resource as outlined here.
Request using Selected Option ID's
POST /v1/import/url HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"correlationId": "3127",
"url": "https://example.com/file.pdf"
"selectedOptionIds": [4, 8, 16]
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"categorisationId": 1235,
"correlationId": "3127",
"url": "https://example.com/file.pdf"
}
OR
Request using Categorisation ID
POST /v1/import/url HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"correlationId": "3127",
"url": "https://example.com/file.pdf"
"categorisationId": 1234,
}
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"categorisationId": 1234,
"correlationId": "3127",
"url": "https://example.com/file.pdf"
}
URL Import Status
To get a URL's status, use pass the correlationId
to below endpoint.
GET /v1/import/url/${correlationId}/status HTTP/1.1
Accept: application/json
Response
HTTP/1.1 200 Created
Content-Type: application/json
{
"data": [
{
"asset": {
"id": 123,
"status": "ready"
},
"review": {
"id": 128,
"status": "finished"
},
"errors": null
},
{
"asset": {
"id": 124,
"status": "pending-upload"
},
"review": {
"id": null,
"status": null
},
"errors": null
}
],
"links": {
"first": "https://api.us.redmarker.ai/v1/import/url/1234567890/status?page=1",
"last": null,
"prev": null,
"next": null,
},
"meta": {
"current_page": 1,
"from": 1,
"path": "https://api.us.redmarker.ai/v1/import/url/1234567890/status",
"per_page": 15,
"to": 15
}
}