{"_id":"5d894c691cecab003e9e1af9","project":"59de6011debd1200240f68ec","version":{"_id":"59de6011debd1200240f68ee","__v":3,"project":"59de6011debd1200240f68ec","createdAt":"2016-06-20T18:15:42.514Z","releaseDate":"2016-06-20T18:15:42.514Z","categories":["59de6011debd1200240f68fb","59de6011debd1200240f68fa","59de6011debd1200240f68fc","59de6011debd1200240f68f8","59de6011debd1200240f68f7","59de6011debd1200240f68f9","59de6011debd1200240f68fd","59de6011debd1200240f68fe","59de6011debd1200240f68ff","5a8bfb99f4146e00449cec47","5a8bfcf2e86f530012159bb2","5cd4c29c6ea1040056ec0f55"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"category":{"_id":"59de6011debd1200240f68fa","project":"59de6011debd1200240f68ec","version":"59de6011debd1200240f68ee","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-19T01:01:16.044Z","from_sync":false,"order":2,"slug":"endpoints","title":"Applicant Management"},"user":"547504ed59fade080004cb8b","__v":12,"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-09-23T22:51:21.568Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl -X POST -H 'X-ACCESS-TOKEN: secret-api-token' 'https://api.fountain.com/v2/applicants/22222222-0000-0000-0000-000000000000/secure_documents/link_upload?key=drivers_license&s3_key=abc/def/ghi_file.jpg'\n\n","language":"curl"},{"code":"www.onboardiq.com/api/v2/applicants/22222222-0000-0000-0000-000000000000/secure_documents/?api_token=secret-api-token","language":"text"}]},"method":"post","results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"uploaded\": true\n}"}]},"settings":"","auth":"required","params":[{"_id":"576848f3d98cfd0e00676135","ref":"","in":"query","required":false,"desc":"","default":"secret-api-token","type":"string","name":"api_token"},{"_id":"579bf03db764640e007b4e58","ref":"","in":"path","required":true,"desc":"An applicant's UUID","default":"22222222-0000-0000-0000-000000000000","type":"string","name":"applicant_id"},{"_id":"5d894c3142931b044817dff4","ref":"","in":"header","required":false,"desc":"Access Token","default":"secret-api-token","type":"string","name":"X-ACCESS-TOKEN"},{"_id":"5d894dc81cecab003e9e1b20","ref":"","in":"query","required":false,"desc":"Applicant Data Key (ex: drivers_license)","default":"","type":"string","name":"key"},{"_id":"5d894dc81cecab003e9e1b1f","ref":"","in":"query","required":false,"desc":"Key returned by S3 after upload","default":"","type":"string","name":"s3_key"}],"url":"/applicants/:applicant_id/secure_documents/link_upload"},"isReference":false,"order":8,"body":"This is Part 2 to adding documents to an applicant's profile. Please refer to [Document Upload to S3](doc:upload-document)  for Part 1. \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Not to be confused by S3's Object 'Key', the `key` refers to Fountain's identifier for the file you're uploading. In the Product, this is known as \\\"Data Key\\\". The S3 Object Key is passed in as `s3_key`.\",\n  \"title\": \"Two \\\"key\\\"\"\n}\n[/block]\nWe recommend using the same `key` for similar files you're collecting from applicants to prevent the creation of duplicate data keys. Example, if all your applicants have a resume, upload all the resume documents as `resume_file`. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import json\\nimport xml.etree.ElementTree\\nimport mimetypes\\nimport os\\nimport requests\\n\\nHOST=\\\"api.fountain.com\\\"\\nAPI_KEY=\\\"K-9NB9DkxU7NdrB9eRBHCA\\\"\\nAPPLICANT=\\\"6d0d9434-2817-4b96-9ad4-e33a7f2a0adb\\\"\\nFILENAME=\\\"dog.jpg\\\"\\nUPLOAD_FILE=(FILENAME, open(FILENAME, 'rb'), mimetypes.guess_type(FILENAME)[0])\\nUPLOAD_KEY=\\\"test\\\"\\n\\nUPLOAD_URL=\\\"https://%s/v2/applicants/%s/secure_documents/upload\\\" % (HOST, APPLICANT)\\nLINK_UPLOAD_URL=\\\"https://%s/v2/applicants/%s/secure_documents/link_upload\\\" % (HOST, APPLICANT)\\n\\nHEADERS = { 'X-ACCESS-TOKEN': API_KEY }\\n\\nupload_response = requests.post(UPLOAD_URL, headers=HEADERS)\\nupload_response_json = json.loads(upload_response.text)\\nform_data = upload_response_json['form_data']\\nform_data['Content-type'] = \\\"\\\"\\n\\ns3_upload_response = requests.post(upload_response_json['url'], data=form_data, files={'file': UPLOAD_FILE})\\n\\ns3_upload_response_xml = xml.etree.ElementTree.fromstring(s3_upload_response.text)\\ns3_filename = s3_upload_response_xml.find(\\\"Key\\\").text\\n\\nfinish_upload_data = {\\n    'key': UPLOAD_KEY,\\n    's3_key': s3_filename,\\n    'size': os.path.getsize(FILENAME),\\n}\\nfinish_upload_response = requests.post(LINK_UPLOAD_URL, headers=HEADERS, data=finish_upload_data)\\nprint(finish_upload_response)\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]","excerpt":"Accessing documents from Fountain","slug":"link-applicant-documents","type":"endpoint","title":"Link Applicant to Documents in S3"}

postLink Applicant to Documents in S3

Accessing documents from Fountain

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

applicant_id:
required
string22222222-0000-0000-0000-000000000000
An applicant's UUID

Query Params

api_token:
stringsecret-api-token
key:
string
Applicant Data Key (ex: drivers_license)
s3_key:
string
Key returned by S3 after upload

Headers

X-ACCESS-TOKEN:
stringsecret-api-token
Access Token

Examples


Result Format


Documentation

This is Part 2 to adding documents to an applicant's profile. Please refer to [Document Upload to S3](doc:upload-document) for Part 1. [block:callout] { "type": "warning", "body": "Not to be confused by S3's Object 'Key', the `key` refers to Fountain's identifier for the file you're uploading. In the Product, this is known as \"Data Key\". The S3 Object Key is passed in as `s3_key`.", "title": "Two \"key\"" } [/block] We recommend using the same `key` for similar files you're collecting from applicants to prevent the creation of duplicate data keys. Example, if all your applicants have a resume, upload all the resume documents as `resume_file`. [block:code] { "codes": [ { "code": "import json\nimport xml.etree.ElementTree\nimport mimetypes\nimport os\nimport requests\n\nHOST=\"api.fountain.com\"\nAPI_KEY=\"K-9NB9DkxU7NdrB9eRBHCA\"\nAPPLICANT=\"6d0d9434-2817-4b96-9ad4-e33a7f2a0adb\"\nFILENAME=\"dog.jpg\"\nUPLOAD_FILE=(FILENAME, open(FILENAME, 'rb'), mimetypes.guess_type(FILENAME)[0])\nUPLOAD_KEY=\"test\"\n\nUPLOAD_URL=\"https://%s/v2/applicants/%s/secure_documents/upload\" % (HOST, APPLICANT)\nLINK_UPLOAD_URL=\"https://%s/v2/applicants/%s/secure_documents/link_upload\" % (HOST, APPLICANT)\n\nHEADERS = { 'X-ACCESS-TOKEN': API_KEY }\n\nupload_response = requests.post(UPLOAD_URL, headers=HEADERS)\nupload_response_json = json.loads(upload_response.text)\nform_data = upload_response_json['form_data']\nform_data['Content-type'] = \"\"\n\ns3_upload_response = requests.post(upload_response_json['url'], data=form_data, files={'file': UPLOAD_FILE})\n\ns3_upload_response_xml = xml.etree.ElementTree.fromstring(s3_upload_response.text)\ns3_filename = s3_upload_response_xml.find(\"Key\").text\n\nfinish_upload_data = {\n 'key': UPLOAD_KEY,\n 's3_key': s3_filename,\n 'size': os.path.getsize(FILENAME),\n}\nfinish_upload_response = requests.post(LINK_UPLOAD_URL, headers=HEADERS, data=finish_upload_data)\nprint(finish_upload_response)", "language": "python" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}