swagger: '2.0' info: title: OpenTokRTC_v2 API description: >- OpenTok Demo App, v2.0 path and API description. TO-DO: Add here a general description of the page navigation. version: 1.0.0 host: opentokrtc.com schemes: - https basePath: / produces: - application/json x-implementation-module: serverMethods.js x-implementation-middleware: - configReady - iframingOptions paths: /room/{roomName}: get: summary: Connects to a new or existing room. x-implemented-in: getRoom description: >- Returns an HTML document that shows the defined UI for a chat 'room' where the user may or may not have specified an identity. The document returned will NOT have any of the information needed to connect to the Tokbox servers already factored in. TO-DO: ¿Queremos que esto sea así o que devolvamos ya todo configurado? parameters: - name: roomName in: path type: string description: Name of the room. required: true - name: userName description: Name/Id of the user that is connecting. in: query required: false type: string tags: - Rooms responses: '200': description: The HTML for the room schema: $ref: '#/definitions/RoomHTML' /updateArchiveInfo: post: summary: Callback for the OpenTok Archive API. x-implemented-in: postUpdateArchiveInfo description: >- Gets the updated information for a recording archive. parameters: - name: id in: body description: Id of the updated archive required: true type: string - name: createdAt in: body description: The timestamp for when the archive started recording, expressed in milliseconds since the Unix epoch (January 1, 1970, 00:00:00 UTC). required: true type: string - name: duration in: body description: The duration of the archive in seconds. For archives that have are being recorded (with the status property set "started"), this value is set to 0. required: true type: string - name: name in: body description: The name of the archive you supplied (this is optional) required: true type: string - name: partnerId in: body description: Your OpenTok API key. required: true type: string - name: reason in: body description: For archives with the status "stopped", this can be set to "90 mins exceeded", "failure", "session ended", "user initiated". For archives with the status "failed", this can be set to "system failure". required: true type: string - name: sessionId in: body description: The session ID of the OpenTok session that was archived. required: true type: string - name: size in: body description: The size of the archive file. For archives that have not been generated, this value is set to 0. required: true type: string - name: status in: body description: The status of the archive. Only 'available' and 'uploaded' statuses are actually processed. required: true type: string - name: url in: body description: The download URL of the available archive file. This is only set for an archive with the status set to "available"; for other archives, (including archives with the status "uploaded") this property is set to null. The download URL is obfuscated, and the file is only available from the URL for 10 minutes. To generate a new URL, use the REST API for retrieving archive information or listing archives. required: true type: string tags: - Archives responses: '200': description: OK /room/{roomName}/info: get: summary: Information needed to connect to the TB servers. x-implemented-in: getRoomInfo description: >- Returns the information (sessionId, token, apiKey) that's required to connect to an opentok session. The sessionId returned is specific for the room, and the token MAY include information about the user that's connecting (identified as anonymous if the user didn't specify a name). Note that every time this URL is fetched a new token is created. parameters: - name: roomName in: path description: Name of the room. required: true type: string - name: userName in: query description: Name of the user. required: false type: string tags: - Rooms responses: '200': description: Information to connect to the room schema: $ref: '#/definitions/RoomInfo' '400': description: Unexpected error schema: $ref: '#/definitions/ErrorInfo' /room/{roomName}/archive: post: summary: Starts/stop an archiving operation. x-implemented-in: postRoomArchive description: >- Starts or stops an archiving operation. Returns the information about the new recording, and inserts that information on the firebase record associated to the room. Once a recording is in process, succesives call with operation=start are ignored and the existing record of the current archive is returned. tags: - Archives parameters: - name: roomName in: path description: Name of the room. required: true type: string - name: userName in: formData description: Name of the user. required: true type: string - name: operation in: formData description: Operation (startComposite/startIndividual/stop). required: true type: string responses: '200': description: Information about the archive being recorded schema: $ref: '#/definitions/ArchiveInfo' '400': description: Unexpected error schema: $ref: '#/definitions/ErrorInfo' /archive/{archiveId}: get: summary: Gets and returns a temporary archive URL. x-implemented-in: getArchive description: >- Creates a new temporary archive URL to allow the visualization or download of an existing archive. The URL created is valid for 10 minutes only! What this API actually does is just returning a 301 with the actual download URL tags: - Archives parameters: - name: archiveId in: path description: Id of the archive. required: true type: string - name: generatePreview in: path description: If the parameter is present (the value is irrelevant) the server should generate and return an HTML page that embeds the video instead of returning the video directly. required: false type: string responses: '301': description: Information to download or view the archive file. schema: $ref: '#/definitions/ArchiveURL' '200': description: HTML with the video embedded. schema: $ref: '#/definitions/ArchiveURL' '400': description: Unexpected error schema: $ref: '#/definitions/ErrorInfo' delete: summary: Erases an archive. x-implemented-in: deleteArchive description: >- Erases an stored archive. tags: - Archives parameters: - name: archiveId in: path description: Id of the archive. required: true type: string responses: '200': description: Archive erases. schema: $ref: '#/definitions/ArchiveInfo' '400': description: Unexpected error schema: $ref: '#/definitions/ErrorInfo' definitions: RoomHTML: type: string description: HTML document of the room RoomInfo: type: object properties: sessionId: type: string apiKey: type: string token: type: string username: type: string firebaseURL: type: string firebaseToken: type: string ArchiveInfo: type: object properties: archiveId: type: string archiveType: type: string ArchiveURL: type: string ErrorInfo: type: object properties: code: type: integer format: int32 message: type: string fields: type: string