Reviews
Definition
A Review is when Red Marker scan an Asset for risky content using Rules. For example, scanning a Marketing Brochure for risk.
Create a Review
Request
POST /v2/reviews HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
"type": "reviews",
"attributes": {},
"relationships": {
"asset": {
"data": {
"type": "assets",
"id": "1002"
}
},
"categorisation": {
"data": {
"type": "categorisations",
"id": "1003"
}
}
}
}
}
Response
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"type": "reviews",
"id": "1001",
"attributes": {
"status": "pending"
},
"relationships": {
"asset": {
"data": {
"type": "assets",
"id": "1002"
}
},
"categorisation": {
"data": {
"type": "categorisations",
"id": "1003"
}
},
"issues": {
"data": []
}
},
"links": {
"self": "https://api.redmarker.ai/v2/reviews/1001"
}
}
}
Retrieving a Review
After creating a Review, you can retrieve it again. This is a good way to check to see if the Review has completed, via the status attribute.
Status success
When the data.attributes.status changes to ready, it indicates Review has completed successfully.
Status failed
If the data.attributes.status changes to failed, it indicates that the Review has failed to complete.
Request
GET /v2/reviews/1001 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Response
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"type": "reviews",
"id": "1001",
"attributes": {
"status": "finished"
},
"relationships": {
"asset": {
"data": {
"type": "assets",
"id": "1002"
}
},
"categorisation": {
"data": {
"type": "categorisations",
"id": "1003"
}
},
"issues": {
"data": []
}
},
"links": {
"self": "https://api.redmarker.ai/v2/reviews/1001",
"downloadPdf": "https://api.redmarker.ai/v2/reviews/1001/download/pdf",
"downloadXfdf": "https://api.redmarker.ai/v2/reviews/1001/download/xfdf"
}
}
}
Error conditions
If a Review fails to complete, the data.attributes.status will be failed.
If there are errors processing one or more of the Rules during a Review, the status will be finished but an additional data.attributes.errors element will be available. This contains details on which rules failed to complete. See below for the data structure of these errors.
{
"data":{
"type":"reviews",
"id":"1001",
"attributes":{
"errors":[
{
"status":{
"code":500,
"message":"Advance rule `LanguageTool Grammar Rule:Grammar` is invalid"
},
"rule_id":"81979",
"rule_number":"Grammar"
},
{
"status":{
"code":500,
"message":"Advance rule `LanguageTool Plain English Rule:Plain English` is invalid"
},
"rule_id":"81982",
"rule_number":"Plain English"
},
{
"status":{
"code":500,
"message":"Advance rule `Personally identifiable information Rule:PII Detection Rule` is invalid"
},
"rule_id":"82060",
"rule_number":"PII Detection Rule"
}
],
"status":"finished",
"reviewed":false
},
"relationships":{
...
}
},
"included":[
...
]
}
Downloading a Review
Once a review moves into a "finished" status, download links will be available in the data.links section of the response. There are two types available.
A self contained PDF file with the Reviews Annotations embedded for viewing.
XFDF
An XML file which contains only the Annotation information. This is usually intended for more advanced integration techniques. More details available here.
Related Resources
Following with the JSON:API Specification, you can include a Review's related resources by adding the include parameter to the query string. The follow resources are available:
| Relationship | URL Key | Description |
|---|---|---|
| Asset | asset |
The Asset this Review will check for risky content |
| Categorisation | categorisation |
The selected Category options assigned to the Review |
| Creator | creator |
The user who created the review |
| Owner | owner |
The company who owns the review (company of the creator) |
Example:
GET /v2/reviews/1001?include=asset,creator,owner HTTP/1.1