Users
There are two types of users defined in the IF Platform.
1. Human: Represents individuals having email and password as login credentials to access the back-office or front-office application of the IF Platform.
2. Machine: Represents machines having a private key to generate JWT tokens as authentication information to access the API of the IF Platform.
There are two categories of users defined in the IF Platform.
1. Internal: Users that can access the back-office application or platform API. Human users in this category are usually employees of your company.
2. External: User that can access the front-office application. Human users in this category are usually users belonging to clients or clients themselves.
The current endpoints, defined below, can be used to access or manipulate data of external human users. Internal users and machine users are not available via these endpoints.
Creating A User
There is only one way to create an external human user on the IF Platform.
1. External Human Invitation: Invitation via Email
Users can be invited to corporate clients.
List of values that userClientRelation can be set as:
- director
- shareholder
- director-and-shareholder
- authorized-person
{
"workflow": {
"code": "human.external.invitation"
},
"data": {
"user": {
"email": "[email protected]",
"givenName": "Bariscan",
"familyName": "Akin"
},
"invitations": [
{
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "director"
},
{
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "authorized-person"
}
]
},
"connect": {},
"metadata": {}
}
{
"workflow": {
"code": "human.external.invitation"
},
"data": {
"user": {
"email": "[email protected]",
"givenName": "Bariscan",
"familyName": "Akin",
"category": "external",
"type": "human"
},
"invitations": [
{
"id": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "director",
"status": "pending"
},
{
"id": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "authorized-person",
"status": "pending"
}
]
},
"connect": {},
"metadata": {}
}
Possible values of user invitation status:
- pending (initial status)
- accepted
- rejected
- cancelled
Accessing User Data
Invited users won't be available via these APIs until they have accepted their invitation. This is because user resources are created after an invitation is accepted. You can check the statuses of existing invitations using the APIs defined in the following section.
List Users
GET /users
data.user.userCategory is a required query parameter. It must be either one of internal or external.
internal lists Back-office users.
external lists Front-office users.
{
"workflow": {},
"data": {
"users": [
{
"id": "00000000-0000-0000-0000-000000000000",
"email": "[email protected]",
"givenName": "Elif",
"familyName": "Matraç",
"category": "external",
"type": "human"
},
{
"id": "00000000-0000-0000-0000-000000000000",
"email": "[email protected]",
"givenName": "John",
"familyName": "Doe",
"category": "external",
"type": "human"
}
]
},
"connect": {},
"metadata": {
"page": {
"size": 10,
"number": 0,
"totalElements": 2,
"totalPages": 1
}
}
}
Get a User
GET /users/{userId}
{
"workflow": {},
"data": {
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"email": "[email protected]",
"givenName": "Elif",
"familyName": "Kiril",
"category": "external",
"type": "human"
}
},
"connect": {},
"metadata": {}
}
Accessing User Invitations
User invitations can be queried using the email of the invited user.
List User Invitations
GET /users/{userEmail}/invitations
{
"workflow": {},
"data": {
"userInvitations": [
{
"id": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "authorized-person",
"status": "pending"
}
]
},
"connect": {},
"metadata": {
"page": {
"size": 10,
"number": 0,
"totalElements": 1,
"totalPages": 1
}
}
}
Get a User Invitation
GET /users/{userEmail}/invitations/{usersInvitationId}
{
"workflow": {},
"data": {
"userInvitation": {
"id": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000",
"userClientRelation": "authorized-person",
"status": "pending"
}
},
"connect": {},
"metadata": {}
}
Accessing User Client Relations
User client relations are created after an invitation is accepted by the user. This data can be accessed using the ID of the user.
List User Client Relations
GET /users/{userId}/client-relations
{
"workflow": {},
"data": {
"user": [
{
"id": "00000000-0000-0000-0000-000000000000",
"userId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
]
},
"connect": {},
"metadata": {
"page": {
"size": 10,
"number": 0,
"totalElements": 1,
"totalPages": 1
}
}
}
Get a User Client Relation
GET /users/{userId}/client-relations/{id}
{
"workflow": {},
"data": {
"userClientRelation": {
"id": "00000000-0000-0000-0000-000000000000",
"userId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
},
"connect": {},
"metadata": {}
}
Updated 5 months ago