Element451Integrations Guide

Importing Documents

Updated Article

URL#

json
POST https://{{client}}.api.451.io/v2/users/documents/import

Body Schema#

json
    "file" : <file>
    "match_key" : ""
    "match_value" : ""
    "folder" :""
    "tags[]" : ""
    "tags[]" : ""
    "document_type" : ""
    "context[application_guid]" : ""
    "context[registration_id]" : ""
  • "file": <file> - (required) The file content to be uploaded.
  • "match_key" : "" - (optional) The attribute used to match the user with the given value. Use a key from the Matching Attribute Key table.
  • "match_value" : (optional) The value to match the user by the given attribute key. If the key/value are not provided, it will either be put in the specific folder or the all files document bin.
  • "folder" : "guid" - (optional) Folder guid matching an existing documents folder.
  • "tags[]" : "guid" - (optional) Tag guid matching an existing documents tag. Can be repeater to add multiple tags at once. You can change it to be “Tags[#]” if multiple keys are not allowed.
  • “document_type” : “guid” - (optional) Document type guid. See Tips and Tricks for finding a guid.
  • "context[application_guid]": "guid" - (optional) Value to be set on File context. Links to a specific application guid.
  • "context[registration_id]": "string" - (optional) Value to be set on File context. Links for a specific application user ID.

Tips#

  • When using Postman, the values are sent in the body under “Form-Data”. This is different than importing and exporting which uses “raw” and json to send post the request.
  • In Postman “tags[]” can be repeated as a Key/Value pair. However, if using python, for example, and creating a dictionary, each “tags[]” needs to be different. You’ll want to include a a number inside the []. (For example - {”tags[1]”: “client.taxonomy.201942”, “tags[2]”: “client.taxonomy.201948”},....} )

Matching Attribute Keys#

AttributeKey
AttributeKey
Act Idact:id
Campus Nexuscampus_nexus:id
Coalition Idcoalition:id
College Board Idcollege_board:id
Common App Idcommonapp:id
Encouraencoura:id
Ethos Idethos:id
Historic Idhistoric:id
Parchment Idparchment:id
Salesforce Idsalesforce:id
School Emailschool-email
School Idschool:id
Search Idsearch:id
Scoirscoir:id
Spark Idspark:id
User Emailuser:email_address
User Iduser:id, element:id

Example 1 - Document Import

json
Request:
POST https://{{client}}.{{api}}/v2/users/documents/import

URL parameters:
{{client}}: Assigned client subdomain.
{{api}}: URL of the Element451 API. "api.451.io" for Production API.

Request headers:
Feature: Feature token for that client
Authorization: Bearer API Key
Content-Type: 'multipart/form-data' (Postman automatically adds this). 

Request body/form-data parameters:

    "file" => <File>
    "match_key" => "user:email_address"
    "folder" => "client.taxonomies.451"
    "tags[]" => "client.taxonomies.452"
    "tags[]" => "client.taxonomies.453"
    "context[application_guid]" => "client.applications.451"
    "context[registration_id]" => "4mzsxbue"


Expected Response:
Status 201
{
    "data": [
        {
            "name": "pdf-test.pdf",
            "result": "uploaded",
            "file": {
                "guid": "client.files.28969",
                "name": "pdf-test.pdf",
                "size": 20597,
                "extension": "pdf",
                "mime_type": "application/pdf",
                "created_at": "2021-12-13T18:38:14+00:00"
            }
        }
    ]
}