Comment créer un nouvel appel xAssist à l'aide de l'API ?
Condition préalable : Fonctionnalité de connexion et d'actualisation opérationnelle
1. Recueillir des informations d'identification valides.
2. Établissez un appel de poste en utilisant le point de terminaison /rtc/createCall
et configurez le corps de la demande comme expliqué ci-dessous.
Corps de la demande annotée JSON :
{
"callTitle": "Test Call", \\Name of the call
"callReason": "STANDARD", \\Either Standard or SERVICE_REQUEST
"callType": "SFU", \\ Defines the call technology used eg. MESH for 1:1 calls or SFU for Multicalls
"invitedContacts": [ \\ List of multiple CallLogContact objects
{
"displayName": "Tester",
"domain": "ubimax",
"email": "test@test.de",
"phoneNumber": "",
"userDbId": 8, \\The database id of the user, which the contact is linked too.
"userId": "tester" \\The user id id of the user, which the contact is linked too.
}
],
"invitedTeams": [], \\ Leave empty or add a team object to invite a whole team.
"joinAnonymousAllowed": true, \\ Set to true to allow anonymous joins else false
"informOthersDirectly": true, \\ Set to true to trigger the call notification pop-up on invited contacts screen
"creatorUser": 12, \\ The database id of the user. Leave empty or Set it to create calls on behalf of someone, behaving as a broker.
Corps de la réponse annotée JSON ( objetCallLog
) :
Note : Certains champs sont omis par souci de concision.
{
"id": 842, \\Incremental id generated by the database
"callId": "e76e1d8a-8267-4bd4-ba5c-00ab76743e74", \\UUID generated by the application
"anonymousJoinAllow": true, \\Whether anonymous joins are allowed or not
"callStatus": "Ended", \\Possible values: Planned, Started or Ended
"creatorContact": { \\ CallLogContact object. References the user that generated the call or the “creatorUser” specified when creating the call.
...
}
"invitedContacts": [ \\ List of multiple CallLogContact objects
{
...
}
]
"callEvents": [ \\ List of multiple call Events
{
"id": 234, \\Incremental id generated by the database
"type": "Created", \\Possible values: Created, Join, Leave, between others.
"contact": { \\ CallLogContact object. References the user related with the current event.
...
}
}
]
3. Le serveur notifie les contacts invités via WebSocket, Mail ou SMS (si défini dans CallLogContactObject)
.
Comment connaître l'état d'un appel à l'aide de l'API ?
Condition préalable : Fonctionnalité de connexion et d'actualisation opérationnelle
1) Recueillir des informations d'identification valides.
2. établir un appel en utilisant le point de terminaison /rtc/getCallLogById?callId=value
avec le callId
obtenu à partir de la réponse du point de terminaison createCall
mentionné ci-dessus.
Corps de la réponse annotée JSON :
Même réponse que le point de terminaison createCall
. Par exemple, pour un appel maillé en cours émis par callertest1 vers callertest2, les événements seraient les suivants :
"callEvents": [
{
"id": 697,
"type": "Created",
"contact": {
"id": 1,
"userId": "callertest1",
"userDbId": 8
}
},
{
"id": 698,
"type": "Join",
"contact": {
"id": 1,
"userId": "callertest1",
"userDbId": 8
}
},
{
"id": 699,
"type": "Join",
"contact": {
"id": 2,
"userId": "callertest2",
"userDbId": 9
},
}
],
Comment créer un appel maillé à partir du connecteur ?
Utilisez les méthodes exposées par la RtcControllerApi
. Les méthodes les plus importantes sont createCallForContacts
pour créer l'appel et getCallLogById
pour connaître l'état de l'appel.
Pour créer un appel, utilisez la propriété creatorUser
mentionnée précédemment. Définissez-la à l'ID
de l'utilisateur des lunettes intelligentes et ajoutez l'utilisateur de l'expert et l'utilisateur du connecteur au tableau des contacts invités
. Le connecteur se comporte donc comme un courtier. Gardez à l'esprit que l'utilisateur smartglasses ne sera appelé que lorsque l'utilisateur expert répondra à l'appel.
Diagramme de séquence
Exemple Node.js
Appel d'exemple Node.js (dépouillé, pouvant nécessiter des en-têtes de sécurité et des cookies supplémentaires, collectés via une connexion).
fetch("https://<serverurl>/rtc/createCall", {
"headers": {
"authorization": "Bearer <token>",
},
"body": "{\"callType\":\"SFU\",\"invitedContacts\":[{\"userId\":\"tester\",\"userDbId\":8,\"email\":\"test@test.com\",\"domain\":\"ubimax\",\"displayName\":\"Tester\",\"phoneNumber\":null}],\"invitedTeams\":[],\"joinAnonymousAllowed\":false,\"callTitle\":\"New Call\",\"plannedDateTime\":null,\"callReason\":\"STANDARD\"}",
"method": "POST",
"mode": "cors"
});