This article describes how to utilize the PDF Scout inspector to analyze incoming plan review documents to eplansoft REVIEW (EPR).
All public facing portals/customer portals should implement calls to Scout to evaluate whether plan review documents are acceptable.
How it works
Incoming plan review documents are uploaded to a temporary location on the eplansoft AWS server. Scout performs a 'read analysis' to identify known issues that will prevent EPR from accepting the document for plan review.
Once the Scout inspection finishes, a json response is returned and the documents are deleted from AWS.
Prerequisites
- See: Scout PDF Inspector
Step-by-step guide
To inspect a .PDF file using Scout APIs, follow these steps:
Get a token.
Obtain the credentials from the EPR Environment/Partners page. See Accessing the Connect API for partner integration via Swagger
- Get an upload url
- Upload file using the url from step 2
- Call Scout to get the json result.
Step 1. Get a token
POST https://scout-api.eplansoftreview.com/api/auth
Request Body format:
{ "username": "admin_username", "password": "admin_password" }
Sample Response:
{ "success": true, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImVwbGFuYWRtaW4iLCJpYXQiOjE1MjU0NDk2MDcsImV4cCI6MTUyNTQ1MzIwN30.5uRl1WIjpGwJaA-qVbnYI_wenzKl0bRy6RPuvp2WUzo" }
Step 2. Get an Upload Url
GET https://scout-api.eplansoftreview.com/api/uploadUrl?filename=your_filename
Sample Response:
{ "success": true, "message": "Use the method and url to upload file to Scout server.", "data": { "method": "PUT", "url": "https://eplan-scout.s3.us-west-2.amazonaws.com/1525449678912evil.pdf?Content-Type=application%2Fpdf&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIGT7NUYPP3IOYOBA%2F20180504%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20180504T160118Z&X-Amz-Expires=300&X-Amz-Signature=0cf8ad94edf98902134f7909246549d2b1059fc228bb2054f9fea42d33f2f1a2&X-Amz-SignedHeaders=host", "contentType": "application/pdf", "filename": "sample.pdf", "filePath": "1525449678912sample.pdf" } }
Step 3. Upload file to Scout Server
PUT [url_from_last_step]
Note: You must upload file using the PUT method.
Step 4. Call Scout api to get the result
POST
https://scout-api.eplansoftreview.com/api/scout
Request Body format:
{ "filePath": "filePath from step 2 response body" }
Sample Response:
{ "success": true, "data": { "filename": "1525449678912sample.pdf", "filesize": 73121, "numPages": 1, "outlines": null, "results": [ { "key": "accessible", "success": true, "value": null }, { "key": "version", "success": true, "value": "1.7" }, { "key": "size", "success": true, "value": "0.07MB" }, { "key": "rotation", "success": true, "value": null }, { "key": "pageAccess", "success": true, "value": null }, { "key": "annotation", "success": true, "value": null }, { "key": "resolution", "success": true, "value": null } ], "pages": [ { "pageNumber": 1, "dimension": { "pageNumber": 1, "mediaBox": [ 0, 0, 1728, 1296 ], "rotate": 0, "orientation": "Landscape", "width": 1728, "height": 1296 }, "pageAccess": { "value": null, "errMessage": null, "debugData": null }, "annotation": { "value": null, "errMessage": null, "debugData": null }, "resolution": { "value": null, "errMessage": null, "debugData": null } } ], "pageDimensions": { "1": { "pageNumber": 1, "mediaBox": [ 0, 0, 1728, 1296 ], "rotate": 0, "orientation": "Landscape", "width": 1728, "height": 1296 } }, "author": "", "version": 1.7, "isPassed": true } }
Determining the Results
Check "isPassed" value in the response body to see if the file passes Scout.
Best Practices
Documents rejected by Scout should be rejected in the public facing/customer portal.