Considering that the registration and obtaining of the credentials were carried out with EU Servers. take the same URL:
https://daas.api.hp.com
1. Get Tenants: With the help of Postman, make the request, as described in the Authentication
The endpoint you will use will be as follows:
GET /analytics/v1/identity/tenants
The result obtained from this petition is:
{
"schemas": [
"urn:scim:schemas:core:2.0:Tenant"
],
"id": "tenant-uuid-1",
"description": "",
"subTypes": [],
"phoneNumber": {
"value": "xxx-xxxx",
"type": "work"
},
"ownerId": "xxxxx@email.com"
}
2. Register the tenant in the configuration file: Use the Id of the answer previously obtained and write in the “uniqueTenant” (Client type tenant).
{
"mappers": [
{
"subtypes": [
"COMPANY_WIDE_BIOS_OUTOFDATE",
"BATTERY_NEEDS_ATTENTION",
"BATTERY_NOT_DETECTED"
],
"filter": "",
"tenantIds": [
],
"case": {
"itemType": "ServiceCall",
"project": 1,
"service": 2,
"category": 2,
"sla": 3,
"company": 1,
"state": [
{
"value": "NEW",
"id": 1
},
{
"value": "FIXED",
"id": 13,
"commentary": "Caso finalizado"
}
],
"urgency": [
{
"value": "CRITICAL",
"id": 4
},
{
"value": "HIGH",
"id": 3
},
{
"value": "LOW",
"id": 2
},
{
"value": "MEDIUM",
"id": 2
},
{
"value": "NOT_ASSIGNED",
"id": -1
}
],
"additionalFields": [
{
"fieldId": 122,
"values": [
"texto prueba"
]
}
]
}
}
],
"uniqueTenant": "tenant-uuid-1",
"companies": [
{
"id": 0,
"tenantId": ""
}
]
}
3. Get Tenant Associates: With the help of Postman, make the request to the following endpoint:
GET /analytics/v1/identity/tenants/children
The result obtained from this petition is:
{
"schemas": [
"urn:scim:schemas:core:2.0:ListResponse"
],
"totalResults": 2,
"startIndex": 0,
"itemsPerPage": 2,
"resources": [
{
"id": "tenant-uuid-children-1",
"displayName": "Children 1",
"type": "CUSTOMER",
"ownerId": "xxx",
"status": "Active",
"subscriptionState": "OVER_ENROLLED",
"owner": {
"..."
},
"parents": [
{
"id": "tenant-uuid-parent-1",
"association": "xxxx",
"name": "xxx xxx",
"primaryAdministrator": {
"xxxx"
}
},
"..."
],
"subTypes": [
null,
null
],
"lastImpersonatedOn": "2020-11-27 16:39:43 UTC",
"impersonatedBy": "xxxx-xxxx-xxxx-xxxx"
},
"..."
]
}
4. Register the tenant in the configuration file: In the answer you get, look for the list of resources and take the Id for each resource you want to associate, write it in the “tenantIds”.
{
"mappers": [
{
"subtypes": [
"COMPANY_WIDE_BIOS_OUTOFDATE",
"BATTERY_NEEDS_ATTENTION",
"BATTERY_NOT_DETECTED"
],
"filter": "",
"tenantIds": [
"tenant-uuid-children-1"
],
"case": {
"itemType": "ServiceCall",
"project": 1,
"service": 2,
"category": 2,
"sla": 3,
"company": 1,
"state": [
{
"value": "NEW",
"id": 1
},
{
"value": "FIXED",
"id": 13,
"commentary": "Caso finalizado"
}
],
"urgency": [
{
"value": "CRITICAL",
"id": 4
},
{
"value": "HIGH",
"id": 3
},
{
"value": "LOW",
"id": 2
},
{
"value": "MEDIUM",
"id": 2
},
{
"value": "NOT_ASSIGNED",
"id": -1
}
],
"additionalFields": [
{
"fieldId": 122,
"values": [
"texto prueba"
]
}
]
}
}
],
"uniqueTenant": "tenant-uuid-1",
"companies": [
{
"id": 0,
"tenantId": ""
}
]
}
5. Relate the tenant associated with the company: Take the tenant ID and match it to the company you selected as follows:
Id tenant Associate | Company Name | Company ID |
---|---|---|
tenant-uuid-children-1 | ARANDA | 1 |
6. Enter the relationship in the companies: Take the relationship created in the previous step and write it as follows:
{
"companies": [
{
"id": 1,
"tenantId": "tenant-uuid-children-1"
}
]
}
As a result, you get the following JSON:
{
"mappers": [
{
"subtypes": [
"COMPANY_WIDE_BIOS_OUTOFDATE",
"BATTERY_NEEDS_ATTENTION",
"BATTERY_NOT_DETECTED"
],
"filter": "",
"tenantIds": [
"tenant-uuid-children-1"
],
"case": {
"itemType": "ServiceCall",
"project": 1,
"service": 2,
"category": 2,
"sla": 3,
"company": 1,
"state": [
{
"value": "NEW",
"id": 1
},
{
"value": "FIXED",
"id": 13,
"commentary": "Caso finalizado"
}
],
"urgency": [
{
"value": "CRITICAL",
"id": 4
},
{
"value": "HIGH",
"id": 3
},
{
"value": "LOW",
"id": 2
},
{
"value": "MEDIUM",
"id": 2
},
{
"value": "NOT_ASSIGNED",
"id": -1
}
],
"additionalFields": [
{
"fieldId": 122,
"values": [
"texto prueba"
]
}
]
}
}
],
"uniqueTenant": "tenant-uuid-1",
"companies": [
{
"id": 1,
"tenantId": "tenant-uuid-children-1"
}
]
}