This API deployment guide will map out the process and requirements in automating the uploading of profile images on person records in intelliHR.
Navigation:
Find a Person
To begin, identify the person you’d like to upload an image for.
💡 See “Creating People & Jobs” guide for steps on Finding a person.
Example: GET https://api.intellihr.io/v1/people/5b84bbf6-a3a7-4d13-895e-d5eb79620dc9
Upload a Profile Image
Create Presigned URL
POST to create a place in amazon for the image to be uploaded - this will return a temporary link which we can then use to instruct Amazon what to store there. Parse the person id in the path parameter (url).
"url": 'https://api.intellihr.io/v1/people/{personId}/images'
"method": 'POST'
"headers": {
"Content-Type": 'application/json',
"Accept": 'application/json',
"Authorization": `Bearer ${apikey}`,
"Tenant": tenantname
}
"body": {
"imageType": “PERSON_PROFILE”,
"extension": png
}
This will return the information you need in order to upload the file to the temporary Amazon S3 bucket.
POST to Amazon, Create Access to Image File
Take returned information and construct a multi-part file upload.
"url": https://<example-bucket-name>.s3.ap-southeast-2.amazonaws.com
"body": {
"x-amz-server-side-encryption": "AES256",
"key": "<your-tenant>/cfe2f82b-fb9f-4044-b77b-1a44612d5fa9-original",
"AWSAccessKeyId": "ASIA6HLWGVLAJALKDSOK",
"x-amz-security-token": "IQoJb3JpZ2luX2VjEKT//////////wEaDmFwLXNvdXRoZWFzdC0yIkcwRQIgNjODBis3wNGYA93luB198gh4gNyViSJC0Hu8UChgMXECIQCXqthkPAGOX+UMMy2vdyOE30EBkV6rGPu8AgPt9OvlLyqxAghtEAIaDDk3Nzg4OTgzMTYzNiIMuFb9qo8aAjQ0rvHZKo4CVo1zxNbD9FHRLUnBtXH5YTF/q9F/wqsTf02upu6WUBriaPsqbJGwDBti/UKbZ8q8yMADOTTe7T/CW8bs4BvClOXVoCo1b7KrjI7MYR8BEWQBqVQ3YB2m4rH0q1oIfZSwAFHUs7+13yyUZ8zPsRrYsU9e4XQEfqK3eeCu+TDlCDXG+SVnjPvZrlpHylLDLurpDquh8MV5CwtPl2SaHFbkLAuUQ/uJY3UHA6gkcjcmAQ8vGHM3pgs4Z0QvZJtWOQsz4xoUIumk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OHE4eU1BRE9UVGU3VC9DVzhiczRCdkNsT1hWb0NvMWI3S3JqSTdNWVI4QkVXUUJxVlEzWUIybTRySDBxMW9JZlpTd0FGSFVzNysxM3l5VVo4elBzUnJZc1U5ZTRYUUVmcUszZWVDdStURGxDRFhHK1NWbmpQdlpybHBIeWxMREx1cnBEcXVoOE1WNUN3dFBsMlNhSEZia0xBdVVRL3VKWTNVSEE2Z2tjamNtQVE4dkdITTNwZ3M0WjBRdlpKdFdPUXN6NHhvVUl1bWtCcG9UaHhYNlRMeWtzOTBQK2N0UjFja2pGc0FxZ2tVV1lTUERQSE5BVURBMXNYZy8vUDUwNlV4RDl4RVNHS3lmc0liVThrNVdjM3VvSXhXa24vd3JIb256cnhUd2RiTUtNUHZueDVNR09wb0JOZi8raDMrN2RUdkRYRVhYckloMGVXa3A5ak5oNDRmbktxRlFYZ0NZSlR4N2xwOHhWUDIwbzRRbkpYUUtWQklMNkdOMUgyVkd4S1E2czdqUkN3Z0RDSUQxUjNRUjU1VUVOTGdSdTg1RkdPR2Y5UnQrZitjSVVrL1ZzaklKWm92OUNjVEs2RHl0TEZJMTAyZUZjS0FHbXdOL3NNL3BJWVhncTBYL3FYZnlkdUJBd2RyUmhTR256dnNYem51aVFCTWljMGNRL2J1SXJyRG1Wdz09In1dfQ==",
"signature": "JGX8ztYJqB+Kkr/m7dzYzzEZPlI=",
"file": "user/downloads/image.png"
}
This has now uploaded the file to the temporary Amazong S3 bucket.
PATCH to promote temporary image
Finally, PATCH the person images endpoint to promote the temporary image as the profile image.
"url": 'https://api.intellihr.io/v1/people/{personId}/images'
"method": 'PATCH'
"headers": {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Bearer ${apikey}`,
'Tenant': tenantname
}
"body": {
"imageType": "PERSON_PROFILE"
}
This will promote the uploaded the document to the person’s profile.