{"_id":"5d894c3142931b044817dff3","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:50:25.470Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n  \"url\": \"https://onboardiq-secure-us-west-1.s3-us-west-1.amazonaws.com\",\n  \"host\": \"onboardiq-secure-us-west-1.s3-us-west-1.amazonaws.com\",\n  \"form_data\": {\n    \"key\": \"8a5f5584-1482-4dba-95a8-3dde08c5c644/6d0d9434-2817-4b96-9ad4-e33a7f2a0adb/0e5d07c5-131a-4f72-80ef-d532bcf843ae_${filename}\",\n    \"success_action_status\": \"201\",\n    \"acl\": \"public-read\",\n    \"x-amz-server-side-encryption-customer-algorithm\": \"AES256\",\n    \"x-amz-server-side-encryption-customer-key\": \"1EROYlamYXQYiUuex1673LZVMkyKYGzATFyGTdFf0/Q=\",\n    \"x-amz-server-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IAIZFLJGWQVS357TVA/20190919/us-west-1/s3/aws4_request\",\n    \"x-amz-algorithm\": \"AWS4-HMAC-SHA256\",\n    \"x-amz-date\": \"20190919T164124Z\",\n    \"x-amz-signature\": \"afbaee1d4fe8d7f67cf62e04d0522d84babbece40bdc5070bec93309cedc437e\"\n  },\n  \"min_size\": 1,\n  \"max_size\": 15728640,\n  \"only_images\": false\n}"}]},"method":"post","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/upload'\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"}]},"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"}],"url":"/applicants/:applicant_id/secure_documents/upload"},"isReference":false,"order":7,"body":"There are 2 parts to uploading documents to an applicant. First is to upload to S3 for your account, which is documented in this article\n\nPart 2 is to link the file to the applicant. See next article on [Link Applicant to Documents in S3](doc:link-applicant-documents) to complete the upload to the applicant.\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":"upload-document","type":"endpoint","title":"Document Upload to S3"}

postDocument Upload to 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

Headers

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

Examples


Result Format


Documentation

There are 2 parts to uploading documents to an applicant. First is to upload to S3 for your account, which is documented in this article Part 2 is to link the file to the applicant. See next article on [Link Applicant to Documents in S3](doc:link-applicant-documents) to complete the upload to the applicant. [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 }}