Skip to content

Commit cf1950c

Browse files
committed
Update api documentation
1 parent aba67dc commit cf1950c

File tree

1 file changed

+142
-0
lines changed

1 file changed

+142
-0
lines changed

documentation/api.md

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ This document will explain how is used the Licensoft-Web API.
1717
* [Check room](#check-room)
1818
* [Add current user to room](#add-current-user-to-room)
1919
* [Get assistants](#get-assistants)
20+
* [Raise hand](#raise-hand)
21+
* [Lower hand](#lower-hand)
22+
* [Get hand raised users](#get-hand-raised-users)
2023
* [OpenVidu requests](#openvidu-requests)
2124
* [Create session](#create-session)
2225
* [Get token](#get-token)
2326
* [Disconnect current user](#disconnect-current-user)
27+
* [Send signal](#send-signal)
2428

2529

2630
## Authorization ##
@@ -310,6 +314,108 @@ Gets all people who are in the room, and specifies their role and wheter or not
310314
}
311315
~~~~
312316

317+
### Raise hand ###
318+
Makes the user raise their hand. This method does not send signals to other users, it just acknowledges that the user did it in the backend.
319+
- **URL**
320+
`/ovTeachingApi/room/{roomName}/raiseHand`
321+
- **Method**
322+
`POST`
323+
- **Required role**:
324+
System: User
325+
Room: Participant
326+
- **Data Params**
327+
Path Variables:
328+
* String roomName\
329+
* Body:
330+
~~~~ json
331+
{
332+
"nickname": string,
333+
"avatar": string,
334+
"connectionId": string
335+
}
336+
~~~~
337+
- **Example**
338+
- **Request**: `/ovTeachingApi/room/roomA/raiseHand`\
339+
Body:
340+
~~~~ json
341+
{
342+
"nickname": "teacher",
343+
"avatar": "https://randomuser.me/api/portraits/thumb/lego/3.jpg",
344+
"connectionId": "con_TEOOVm9ur1"
345+
}
346+
~~~~
347+
Username: teacher
348+
Password: pass
349+
- **Response**:
350+
~~~~ json
351+
1
352+
~~~~
353+
354+
### Lower hand ###
355+
Makes the user lower their hand. This method does not send signals to other users, it just acknowledges that the user did it in the backend.
356+
- **URL**
357+
`/ovTeachingApi/room/{roomName}/raiseHand`
358+
- **Method**
359+
`DELETE`
360+
- **Required role**:
361+
System: User
362+
Room: Participant
363+
- **Data Params**
364+
Path Variables:
365+
* String roomName\
366+
* Body:
367+
~~~~ json
368+
{
369+
"connectionId": string
370+
}
371+
~~~~
372+
- **Example**
373+
- **Request**: `/ovTeachingApi/room/roomA/raiseHand`\
374+
Body:
375+
~~~~ json
376+
{
377+
"connectionId": "con_TEOOVm9ur1"
378+
}
379+
~~~~
380+
Username: teacher
381+
Password: pass
382+
- **Response**:
383+
200 OK
384+
385+
### Get hand raised users ###
386+
Gets all the users who are raising their hand.
387+
- **URL**
388+
`/ovTeachingApi/room/{roomName}/raiseHand`
389+
- **Method**
390+
`GET`
391+
- **Required role**:
392+
System: User
393+
Room: Participant
394+
- **Data Params**
395+
Path Variables:
396+
* String roomName
397+
- **Example**
398+
- **Request**: `/ovTeachingApi/room/roomA/raiseHand`
399+
Username: teacher
400+
Password: pass
401+
- **Response**:
402+
~~~~ json
403+
[
404+
{
405+
"nickname": "teacher",
406+
"connectionId": "con_TEOOVm9ur1",
407+
"avatar": "https://randomuser.me/api/portraits/thumb/lego/3.jpg",
408+
"username": "teacher"
409+
},
410+
{
411+
"nickname": "student1",
412+
"connectionId": "con_BukCBHZJp3",
413+
"avatar": "https://randomuser.me/api/portraits/thumb/lego/4.jpg",
414+
"username": "student1"
415+
}
416+
]
417+
~~~~
418+
313419
## OpenVidu requests ##
314420

315421
### Create session ###
@@ -372,5 +478,41 @@ Removes the current user from the room's session (not the room itself). This als
372478
- **Request**: `/ovTeachingApi/room/roomA/user`
373479
Username: teacher
374480
Password: pass
481+
- **Response**:
482+
200 OK
483+
484+
### Send signal ###
485+
Send an OpenVidu signal from the backend. Intended for moderators only. Users who are subscribed to the signal get the `from` field as undefined (that's how they know the signal came from the backend).
486+
- **URL**
487+
`/ovTeachingApi/room/{roomName}/signal/{type}`
488+
- **Method**
489+
`POST`
490+
- **Required role**:
491+
System: User
492+
Room: Moderator
493+
- **Data Params**
494+
Path Variables:
495+
* String roomName
496+
* String type: The type of the OpenVidu signal. Users must be subscribed to `signal:{type}`\
497+
Body:
498+
~~~~ json
499+
{
500+
"to": string[],
501+
"data": any
502+
}
503+
~~~~
504+
* to: The array of connectionId of the users who will receive the signal
505+
* data: The additional data of the signal
506+
- **Example**
507+
- **Request**: `/ovTeachingApi/room/roomA/signal/lowerYourHand`\
508+
Body:
509+
~~~~ json
510+
{
511+
"to": ["con_BukCBHZJp3"],
512+
"data": undefined
513+
}
514+
~~~~
515+
Username: teacher
516+
Password: pass
375517
- **Response**:
376518
200 OK

0 commit comments

Comments
 (0)