Skip to main content
All CollectionsEnboarder API Docs
Enboarder API Docs: Managing Profiles
Enboarder API Docs: Managing Profiles

Learn to how create, update and delete Profiles using APIs

Adam Faludi avatar
Written by Adam Faludi
Updated over 2 years ago

Profiles, profiles, profiles!

Managing Profiles in Enboarder using our custom APIs can give your account true flexibility.

To get started, here are our unique URLs:

Base URL:


To create a profile:

Endpoint

Using API:

restapi/v1/profile

Using OAuth:

restapi/v2/profile

Method

POST

Sample request

Request header:

Content-Type: application/json 
X-Enboarder-Warning: yes

If:

X-Enboarder-Warning=Yes 

is passed then the system will show warning messages as well.

The system default is :

X-Enboarder-Warning: no

Request Body:


{
"firstName": "string",
"lastName": "string",
"externalid": "unique id like 3f01-b339-82327fead70b",
"contact": {
"email": "valid email like john@example.com",
"mobile": "+9199XXXXXXXXXX",
"preferred": "email | mobile"
},
"profilefields": [
{
"name": "jobTile",
"value": "Developer"
},
{
"name": "Department",
"value": "Product"
},
{
"name": "Employee Number",
"value": "98786"
}
]
"profilePhoto: { // optional
"imageType":"image/jpeg | image/png"
"body": "---- Base 64 Enbcoded Data ---"
}
}

Create Profile Sample Response

On success:

{
"message": "Profile Created",
"id": "3f01-b339-82327fead70b",
"warnings": [
"mobile number is invalid"
]
}

On failure:

{
"errorcode": "MISSING_FIELDS"
"message": "Mandatory fields are missing"
"errors": [
"First Name is missing",
"Both Email and mobile number are missing or invalid",
],
"warnings": [
"mobile number is invalid"
]
}

{
"errorcode": "PROFILE_EXISTS"
"message": "Profile with ID {{externalid}}
already exists"
"errors": [
"First Name is missing",
"Both Email and mobile number are missing or invalid",
]
}


To Update A Profile:

Endpoint

Using API Key :

restapi/v1/profile/{{id}}

Using OAuth:

restapi/v2/profile/{{id}}

Method

Put

Sample Request

Request Header:

Content-Type: application/json
X-Enboarder-Warning: yes

If:

X-Enboarder-Warning=Yes 

is passed then the system will show warning messages as well.

The system default is

X-Enboarder-Warning: no

Request body:

{
"firstName": "string",
"lastName": "string",
"externalid": "unique id like 3f01-b339-82327fead70b",
"contact": {
"email": "valid email like john@example.com",
"mobile": "+9199XXXXXXXXXX",
"preferred": "email | mobile"
},
"profilefields": [
{
"name": "jobTile",
"value": "Developer"
"action": "update | remove" // Optional. The system default is update
},
{
"name": "Department",
"value": "Product"
}
],
"profilePhoto: { // optional
"imageType":"image/jpeg | image/png"
"body": "---- Base 64 Enbcoded Data ---"
}
}

Update Profile Sample Response

On success:

{
"message": "Profile Updated",
"id": "3f01-b339-82327fead70b"
}

On failure:

{
"errorcode": "INVALID_FIELDS"
"message": "email is invalid",
"errors": [
"email is invalid",
]
}

{
"errorcode": "PROFILE_NOT_EXISTS"
"message": "Profile with ID {{externalid}}
not found"
"errors": [
"profile not found with given id"
]
}


To Delete A Profile:

Endpoint

Using API Key :

      restapi/v1/profile/{{id}}

Using OAuth:

restapi/v2/profile/{{id}}

Method

DELETE

Sample Response

On success:

{
"message": "Profile DELETED",
"id": "3f01-b339-82327fead70b"
}

On failure:

{
"errorcode": "ACTIVE_PROFILE"
"message": "profile is associated with
active workflow",
"errors": [
"profile is in active state"
]
}

{
"errorcode": "PROFILE_NOT_EXISTS"
"message": "Profile with ID {{externalid}}
not found"
"errors": [
"profile not found with given id"
]
}


To Get A Profile:

Endpoint

Using API Key :

restapi/v1/profile/{{id}}

Using OAuth:

restapi/v2/profile/{{id}}

Method

GET

Sample Request

Request header:

Content-Type: application/json

Request parameters:

activewf: string (yes/no)

If

activewf=yes 

is passed then the system will return a list of active workflows for this profile up to a maximum of 10.

To retrieve complete list of active workflows one need to call a separated API which returns this list in a paginated way.

Sample Response

{
"firstName": "string",
"lastName": "string",
"externalid": "unique id like 3f01-b339-82327fead70b",
"contact": {
"email": "valid email like john@example.com",
"mobile": "+9199XXXXXXXXXX",
"preferred": "email | mobile"
},
"createdAt": "2021-07-25T07:56:02+0000",
"lastUpdated": "2021-08-26T07:56:02+0000",
"profilefields": [
{
"name": "jobTile",
"value": "Developer"
},
{
"name": "Department",
"value": "Product"
},
{
"name": "Employee Number",
"value": "98786"
}
],
"profilePhoto: {
"imageType":"image/jpeg"
"body": "---- Base 64 Enbcoded Data ---"
},
"activeWorkflows" : [
{
"externalid" : "external unique id of the workflow",
"enboarderUniqueId": "enboarder internal unique id of the workflow",
"workflowName": "Workflow definition name"
}
]
}

On failure:

{
"errorcode": "PROFILE_NOT_EXISTS"
"message": "Profile with ID {{externalid}}
not found"
}

Note: when activewf request parameter is sent and there are more than 10 active workflows for the profile then max. 10 is returned in response with HTTP status code as 206 instead of 200. This way client needs to call another API to get the complete list of active workflows.


To Upload a Profile Photo:

Endpoint

Using API Key:

restapi/v1/profile/{{id}}/photo

Using OAuth:

restapi/v2/profile/{{id}}/photo

Method

PUT

Sample Request

Request header:

Content-Type: application/json

Request body:

{
"imageType":"image/jpeg | image/png"
"body": "---- Base 64 Enbcoded Data ---"
}

Sample Response

On success:

{
"message": "Profile Photo uploaded",
"id": "3f01-b339-82327fead70b"
}

On failure:

{
"errorcode": "PROFILE_NOT_EXISTS"
"message": "Profile with ID {{externalid}}
not found"
}


To Get a Profile Photo:

Endpoint

Using API Key:

restapi/v1/profile/{{id}}/photo

Using OAuth:

restapi/v2/profile/{{id}}/photo

Method

GET

Sample Response

{
"imageType":"image/jpeg"
"body": "---- Base 64 Enbcoded Data ---"
}


To Get Profile Active Workflows:

Endpoint

Using API Key:

restapi/v1/profile/{{id}}/workflows

Using OAuth:

restapi/v2/profile/{{id}}/workflows

Method

GET

Sample Request

Request Header:

Content-Type: application/json

Request Parameters:

nextKey: string

nextKey : If not then will return the first page of response, if provided from the last page response then will fetch and return that page onwards data.

Sample Response

On success:

HTTP status code as 200 and response body as

{
"workflows" : [
{
"status" : {"code": "INIT", value: "In progress"},
"externalid" : "external unique id of the workflow",
"enboarderUniqueId": "enboarder internal unique id of the workflow",
"workflowName": "Workflow definition name"
}
]
"nextKey": "next page reference"
}

Here nextKey is optional and only returned if there is more data. To fetch next page data client needs to call the same api with nextKey request parameter. When nextKey is not returned in response then it means there is no more data.

On failure:

HTTP status code 400 and response body

{
"errorcode": "PROFILE_NOT_EXISTS"
"message": "Profile with ID {{externalid}}
not found"
}

Profile API Error Codes

Error codes

Description

1

MISSING_FIELDS

Mandatory fields are missing

2

PROFILE_EXISTS

Profile exists with the given external id

3

PROFILE_NOT_EXISTS

Profile does not exist with the given external id

4

INVALID_FIELDS

Value of field is invalid

5

ACTIVE_PROFILE

The profile is associated with an active workflow

Warning Message:

In the case the request header, the system got

 X-Enboarder-Warning = yes 

then the system will show a warning message if any. The system default is

X-Enboarder-Warning: no
X-Enboarder-Warning: yes


For help or questions, please reach out directly to your Customer Success Manager to discuss.

Did this answer your question?