Setting Up Custom Evidence Integrations

Note:

Certification Automation can support creating the API Key, Username, Password and URL. Certification Automation cannot support writing code or API calls to send data to the URL. Users can access our Custom API Marketplace (https://community.tugboatlogic.com/categories/custom-api-marketplace) to ask or engage our community. Users can also find examples of custom evidence integrations on GitHub here: https://github.com/PolicyHarbor/evidence-collectors.

Purpose of Document

The Setting Up Custom Evidence Integrations document allows you to customize and add your own integrations to upload specific evidence to a Certification Automation evidence task. This upload is made to the Certification Automation server using HTTP Basic Authorization and an API Key.

Many HTTP clients (e.g. written in Python, Ruby, PHP, C, C#) can be used to upload evidence. Evidence can be uploaded using cURL, a common command-line tool as demonstrated by the following:

CODE
curl -v --user <provided-username>:<given-password> \
 -H "X-API-KEY: <given-x-api-key>" \
 -F "collected=<date-of-evidence>" -F "file=@<local_filename_csv>;type=text/csv" \
 <given-collector-url>

Fields provided by Certification Automation are marked as given. The HTTP client is capable of POSTing Content-Type multipart/form-data according to RFC 2388.

Note:

Supported file types:

CODE
‘txt’, ‘csv’, ‘odt’, ‘ods’, ‘xls’, ‘json’, ‘pdf’, ‘png. ‘gif’, ‘jpg’, ‘jpeg’,

The following filename extensions are not supported:

CODE
'html', 'htm', 'js', 'exe', 'php5', 'pht', 'phtml', 'shtml', 'asa', 'cer', 'asax', 'swf', 'xap'

The following mime types are not supported:

CODE
'html', 'xhtml+xml', 'javascript', 'dosexec', 'shellscript'

Max file upload size is 20MB.

Part 1: Generate an HTTP Header

  1. Select Custom Integrations.

  2. Click the plus to add a new integration.

  3. Enter an Account Name.

  4. Enter a Description (optional).

  5. Click Save and Continue.

  6. Enter a Username.

  7. Click Generate Password.

  8. Copy the Username, Password and X-API-KEY for later use, or click Download JSON and save the resulting file.

    Note:

    The Username, Password and X-API-KEY cannot be recovered again later.

Part 2: Generate an Evidence URL

  1. Click the plus to configure a new evidence service.

  2. Select the scope from the Filter by Scope drop-down menu.

  3. Select the Evidence Task from the Select Evidence Task drop-down menu.

  4. Click Save & Complete.

  5. Click Copy URL (located next to your new evidence service).

  6. Save the URL so you can use it in your command script later.

Part 3: Build a Command Line

  1. Use the HTTP Header(created in Part 1: Generate HTTP Header) and URL (created in Part 2: Generate Evidence URL) to build a POST API Request to upload an evidence file. Include the following in your request:

    • An evidence file: This is the file that will be attached to your Evidence Task. Select a filename with the correct mime type, such as text/csv in the example below.

    • Evidence collection date: This is the date the evidence was generated, and it should be set as an ISO8601 date (yyyy-mm-dd).

  2. Once you have the URL you can add it to your API request. Once you have the collector URL in place, you should see something similar to the following if written in cURL command line:

    CODE
    curl -v --user jamie:XBwgsKLNRwSM2KjVaYc67FJMspeTzjBW \
     -H "X-API-KEY: 762bbc8a-0363-11eb-ae9b-0e8ffbd46778-org-id-11455" \
     -F "collected=2020-09-30" -F "file=@evidence.csv;type=text/csv" \
    https://openapi.tugboatlogic.com/api/v0/evidence/collector/805/