Skip to content

Commit 23d52b8

Browse files
committed
Refactor HiBob user blueprint to enhance user attributes and update API integration details
1 parent df37d92 commit 23d52b8

File tree

1 file changed

+66
-103
lines changed

1 file changed

+66
-103
lines changed

docs/guides/all/map-hibob-users-to-port-accounts.md

Lines changed: 66 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -53,70 +53,40 @@ To represent HiBob users in your portal, we need to create a HiBob User blueprin
5353
"title": "ID",
5454
"description": "The user's unique identifier"
5555
},
56-
"displayName": {
57-
"type": "string",
58-
"title": "Display Name",
59-
"description": "The user's display name"
60-
},
6156
"firstName": {
6257
"type": "string",
6358
"title": "First Name",
6459
"description": "The user's first name"
6560
},
66-
"surname": {
67-
"type": "string",
68-
"title": "Last Name",
69-
"description": "The user's last name"
70-
},
7161
"email": {
7262
"type": "string",
7363
"title": "Email",
7464
"description": "The user's email address"
7565
},
76-
"companyId": {
66+
"department": {
7767
"type": "string",
78-
"title": "Company ID",
79-
"description": "The user's company identifier"
68+
"title": "Department",
69+
"description": "The user's department"
8070
},
81-
"state": {
82-
"type": "string",
83-
"title": "State",
84-
"description": "The user's employment state"
85-
},
86-
"avatarUrl": {
71+
"isManager": {
8772
"type": "string",
88-
"title": "Avatar URL",
89-
"description": "URL to the user's avatar image"
73+
"title": "Is Manager",
74+
"description": "Indicates if the user is a manager"
9075
},
91-
"coverImageUrl": {
76+
"work_title": {
9277
"type": "string",
93-
"title": "Cover Image URL",
94-
"description": "URL to the user's cover image"
78+
"title": "Job Title",
79+
"description": "The user's job title"
9580
},
9681
"fullName": {
9782
"type": "string",
9883
"title": "Full Name",
9984
"description": "The user's full name"
10085
},
101-
"creationDate": {
102-
"type": "string",
103-
"title": "Creation Date",
104-
"description": "When the user was created"
105-
},
106-
"creationDatetime": {
107-
"type": "string",
108-
"title": "Creation DateTime",
109-
"description": "When the user was created (with time)"
110-
},
111-
"isManager": {
112-
"type": "boolean",
113-
"title": "Is Manager",
114-
"description": "Indicates if the user is a manager"
115-
},
116-
"durationOfEmployment": {
86+
"displayName": {
11787
"type": "string",
118-
"title": "Duration of Employment",
119-
"description": "How long the user has been employed"
88+
"title": "Display Name",
89+
"description": "The user's display name"
12090
}
12191
},
12292
"required": []
@@ -179,7 +149,7 @@ Now we need to enhance the Port User blueprint to add a relation to the HiBob Us
179149
6. Click on `Save` to update the blueprint.
180150

181151
:::info Additional mirror properties
182-
You can add more mirror properties to display other HiBob user attributes like full name (`hibob_user.fullName`), manager status (`hibob_user.isManager`), or any other property from the HiBob User blueprint that would be useful for your organization.
152+
You can add more mirror properties to display other HiBob user attributes like job title (`hibob_user.work_title`), department (`hibob_user.department`), manager status (`hibob_user.isManager`), or any other property from the HiBob User blueprint that would be useful for your organization.
183153
:::
184154

185155
<h3> Add Port secrets</h3>
@@ -198,7 +168,7 @@ Now let's add your HiBob credentials to Port's secrets:
198168
```
199169

200170
:::info HiBob Authentication
201-
HiBob uses Basic Authentication with base64 encoding. You'll need to create a service user in HiBob with appropriate permissions to access employee data, then encode the credentials as base64(service_user_id:service_user_token). Learn more about [creating HiBob service users](https://apidocs.hibob.com/docs/api-service-users).
171+
HiBob uses Basic Authentication with base64 encoding. You'll need to create a service user in HiBob with appropriate permissions to access employee data, then encode the credentials as base64(service_user_id:service_user_token). Learn more about [creating HiBob service users](https://apidocs.hibob.com/docs/api-service-users).
202172
:::
203173

204174

@@ -229,75 +199,34 @@ Follow the steps below to create the webhook integration:
229199
"blueprint": "hibob_user",
230200
"operation": "create",
231201
"filter": "(.body.response | has(\"employees\")) and (.body.response.employees | type == \"array\")",
232-
"itemsToParse": ".body.response.employees | map(select(.state != \"inactive\"))",
202+
"itemsToParse": ".body.response.employees | map(select(.email != null))",
233203
"entity": {
234204
"identifier": ".item.id | tostring",
235205
"title": ".item.displayName | tostring",
236206
"properties": {
237207
"id": ".item.id",
238-
"displayName": ".item.displayName",
239208
"firstName": ".item.firstName",
240-
"surname": ".item.surname",
241209
"email": ".item.email",
242-
"companyId": ".item.companyId",
243-
"state": ".item.state",
244-
"avatarUrl": ".item.avatarUrl",
245-
"coverImageUrl": ".item.coverImageUrl",
246-
"fullName": ".item.fullName",
247-
"creationDate": ".item.creationDate",
248-
"creationDatetime": ".item.creationDatetime",
210+
"department": ".item.work.department",
249211
"isManager": ".item.work.isManager",
250-
"durationOfEmployment": ".item.work.durationOfEmployment.humanize"
212+
"work_title": ".item.work.title",
213+
"fullName": ".item.fullName",
214+
"displayName": ".item.displayName"
251215
}
252216
}
253217
},
254218
{
255219
"blueprint": "_user",
256220
"operation": "create",
257221
"filter": "(.body.response | has(\"employees\")) and (.body.response.employees | type == \"array\")",
258-
"itemsToParse": ".body.response.employees | map(select(.state != \"inactive\" and .email != null))",
222+
"itemsToParse": ".body.response.employees | map(select(.email != null))",
259223
"entity": {
260224
"identifier": ".item.email",
261225
"relations": {
262226
"hibob_user": ".item.id | tostring"
263227
}
264228
}
265-
},
266-
{
267-
"blueprint": "hibob_user",
268-
"operation": "create",
269-
"filter": ".body.response.employee != null",
270-
"entity": {
271-
"identifier": ".body.response.employee.id | tostring",
272-
"title": ".body.response.employee.displayName | tostring",
273-
"properties": {
274-
"id": ".body.response.employee.id",
275-
"displayName": ".body.response.employee.displayName",
276-
"firstName": ".body.response.employee.firstName",
277-
"surname": ".body.response.employee.surname",
278-
"email": ".body.response.employee.email",
279-
"companyId": ".body.response.employee.companyId",
280-
"state": ".body.response.employee.state",
281-
"avatarUrl": ".body.response.employee.avatarUrl",
282-
"coverImageUrl": ".body.response.employee.coverImageUrl",
283-
"fullName": ".body.response.employee.fullName",
284-
"creationDate": ".body.response.employee.creationDate",
285-
"creationDatetime": ".body.response.employee.creationDatetime",
286-
"isManager": ".body.response.employee.work.isManager",
287-
"durationOfEmployment": ".body.response.employee.work.durationOfEmployment.humanize"
288-
}
289-
}
290-
},
291-
{
292-
"blueprint": "_user",
293-
"operation": "create",
294-
"filter": ".body.response.employee != null and .body.response.employee.email != null",
295-
"entity": {
296-
"identifier": ".body.response.employee.email",
297-
"relations": {
298-
"hibob_user": ".body.response.employee.id | tostring"
299-
}
300-
}
229+
301230
}
302231
]
303232
```
@@ -350,16 +279,29 @@ Follow the steps below to create the action:
350279
},
351280
"invocationMethod": {
352281
"type": "WEBHOOK",
353-
"url": "{{ .secrets.HIBOB_API_URL }}/people",
282+
"url": "{{ .secrets.HIBOB_API_URL }}/people/search",
354283
"agent": false,
355284
"synchronized": true,
356-
"method": "GET",
285+
"method": "POST",
357286
"headers": {
358287
"RUN_ID": "{{ .run.id }}",
359288
"Content-Type": "application/json",
360-
"Authorization": "Basic {{ .secrets.HIBOB_SERVICE_USER_ID }}:{{ .secrets.HIBOB_SERVICE_USER_TOKEN }}"
289+
"Authorization": "Basic {{ .secrets.HIBOB_BASIC_AUTH }}"
361290
},
362-
"body": {}
291+
"body": {
292+
"showInactive": false,
293+
"fields": [
294+
"root.id",
295+
"root.firstName",
296+
"root.email",
297+
"work.department",
298+
"work.isManager",
299+
"work.title",
300+
"root.fullName",
301+
"root.displayName"
302+
],
303+
"humanReadable": "REPLACE"
304+
}
363305
},
364306
"requiredApproval": false
365307
}
@@ -413,15 +355,36 @@ Follow the steps below to create the action:
413355
},
414356
"invocationMethod": {
415357
"type": "WEBHOOK",
416-
"url": "{{ .secrets.HIBOB_API_URL }}/people?email={{ .inputs.email }}",
358+
"url": "{{ .secrets.HIBOB_API_URL }}/people/search",
417359
"synchronized": true,
418-
"method": "GET",
360+
"method": "POST",
419361
"headers": {
420362
"RUN_ID": "{{ .run.id }}",
421363
"Content-Type": "application/json",
422-
"Authorization": "Basic {{ .secrets.HIBOB_SERVICE_USER_ID }}:{{ .secrets.HIBOB_SERVICE_USER_TOKEN }}"
364+
"Authorization": "Basic {{ .secrets.HIBOB_BASIC_AUTH }}"
423365
},
424-
"body": {}
366+
"body": {
367+
"showInactive": false,
368+
"fields": [
369+
"root.id",
370+
"root.firstName",
371+
"root.email",
372+
"work.department",
373+
"work.isManager",
374+
"work.title",
375+
"root.fullName",
376+
"root.displayName"
377+
],
378+
"filters": [
379+
{
380+
"fieldPath": "root.email",
381+
"operator": "equals",
382+
"values": [
383+
"{{ .inputs.email }}"
384+
]
385+
}
386+
]
387+
}
425388
},
426389
"requiredApproval": false
427390
}
@@ -561,7 +524,7 @@ Follow the steps below to create the automation:
561524
<h3> Create automation to sync HiBob users when a new Port user is added</h3>
562525

563526
To ensure new Port users get mapped to HiBob users automatically, we'll create an automation that triggers when a new Port user is created.
564-
This automation will trigger the [Get HiBob user by email](#get-hibob-user-by-email-self-service-action) action to fetch details of the HiBob user by email and trigger the [process single hibob user automation](#create-automation-to-process-single-hibob-user) for processing.
527+
This automation will trigger the [Get HiBob user by email](#get-hibob-user-by-email-self-service-action) action to fetch details of the HiBob user by email, which will then be processed by the webhook integration.
565528

566529
Follow the steps below to create the automation:
567530

@@ -580,7 +543,7 @@ Follow the steps below to create the automation:
580543
{
581544
"identifier": "ingest_hibob_user",
582545
"title": "Trigger hibob_user ingestion automation",
583-
"description": "This will call the webhook endpoint to ingest a single hibob user",
546+
"description": "This will trigger the Get HiBob user by email action to fetch and ingest a single HiBob user",
584547
"icon": "User",
585548
"trigger": {
586549
"type": "automation",
@@ -631,7 +594,7 @@ Follow the steps below to create the automation:
631594

632595
5. Verify that HiBob users are created in your catalog with proper relationships.
633596

634-
6. Verify that the HiBob user is created in your catalog with proper relationships.
597+
635598

636599
## Conclusion
637600

0 commit comments

Comments
 (0)