{"swagger":"2.0","info":{"description":"REST API","version":"0.0.1","title":"API chat"},"host":"zombie-server","basePath":"/api/chat/","tags":[{"name":"conversation","description":"Everything about your conversation."},{"name":"broascast","description":"Everything about your broadcast."},{"name":"conference","description":"Everything about your conference."},{"name":"user","description":"Everything about your user."}],"schemes":["https"],"paths":{"/conversation/{conversationId}/message/":{"post":{"tags":["conversation"],"summary":"Add a new message to the conversation.","description":"Add a new message to the conversation.","operationId":"addMessage","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"Object that needs to be add to the message","required":false,"schema":{"$ref":"#/definitions/MessageBody"}},{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"}],"responses":{"201":{"description":"Permissions check was successful and the message has been created.","schema":{"$ref":"#/definitions/Message"}},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}}},"/conversation/{conversationId}/message/{messageId}":{"put":{"tags":["conversation"],"summary":"Update an existing message.","description":"Update an existing message.","operationId":"updateMessage","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"},{"name":"messageId","in":"path","description":"Message ID.","required":true,"type":"string"},{"in":"body","name":"body","description":"Object that needs to be update to the message","required":false,"schema":{"$ref":"#/definitions/MessageUpdate"}}],"responses":{"200":{"description":"Permissions check was successful and the message has been updated.","schema":{"$ref":"#/definitions/Message"}},"401":{"description":"Permission failure"},"500":{"description":"Another error occurred"}}},"delete":{"tags":["conversation"],"summary":"Delete a message.","description":"Delete a message.","operationId":"deleteMessage","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"},{"name":"messageId","in":"path","description":"Message ID.","required":true,"type":"string"}],"responses":{"200":{"description":"Permissions check was successful and the message has been deleted."},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}}},"/conversation/":{"post":{"tags":["conversation"],"summary":"Add a new conversation to the chat.","description":"Add a new conversation to the chat.","operationId":"addConversation","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"array","items":{"type":"integer","format":"int64"}},{"in":"body","name":"body","description":"Object that needs to be add to the conversation","required":false,"schema":{"$ref":"#/definitions/ConversationBody"}}],"responses":{"201":{"description":"Permissions check was successful and the conversation can be initiated.","schema":{"$ref":"#/definitions/Conversation"}},"401":{"description":"Permissions failure. User A is not allowed to talk to User B."},"404":{"description":"User not found."},"500":{"description":"Another error coccurred."}}},"get":{"tags":["conversation"],"summary":"Get all conversations.","description":"Get all conversations. Returns a array of conversations.","operationId":"getAllConversation","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"}],"responses":{"200":{"description":"Permissions check was successful and the conversations has been got.","schema":{"$ref":"#/definitions/Conversation"}},"401":{"description":"Permissions failure. User is not allowed permissions."},"404":{"description":"User not found."},"500":{"description":"Another error coccurred."}}}},"/conversation/{conversationId}":{"put":{"tags":["conversation"],"summary":"Update an existing conversation.","description":"Update an existing conversation.","operationId":"updateConversation","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"},{"in":"body","name":"body","description":"Object that needs to be update to the conversation","required":false,"schema":{"$ref":"#/definitions/ConversationUpdate"}}],"responses":{"200":{"description":"Permissions check was successful and the conversation has been updated.","schema":{"$ref":"#/definitions/Conversation"}},"401":{"description":"Permission failure"},"500":{"description":"Another error occurred"}}},"get":{"tags":["conversation"],"summary":"Find conversation by conversationId.","description":"Find conversation by conversationId.","operationId":"getConversationById","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Permissions check was successful and the conversation has been got.","schema":{"$ref":"#/definitions/Conversation"}},"401":{"description":"Permissions failure. User is not allowed permissions."},"404":{"description":"User not found."},"500":{"description":"Another error coccurred."}}},"delete":{"tags":["conversation"],"summary":"Delete a conversation to the chat.","description":"Delete a conversation to the chat.","operationId":"deleteConversation","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"conversationId","in":"path","description":"Identifier of the conversation.","required":true,"type":"integer","format":"int64"}],"responses":{"200":{"description":"Permissions check was successful and the conversation has been deleted."},"401":{"description":"Permissions failure. User is not allowed permissions."},"404":{"description":"User not found."},"500":{"description":"Another error coccurred."}}}},"/broadcast/":{"post":{"tags":["broadcast"],"summary":"Add a new broadcast.","description":"Add a new broadcast.","operationId":"addBroadcast","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"token to be passed as a header.","required":true,"type":"string"},{"in":"body","name":"body","description":"Broadcast object that needs to be added to the broadcast","required":false,"schema":{"$ref":"#/definitions/BroadcastBody"}}],"responses":{"201":{"description":"Permissions check was successful and the broadcast has been created.","schema":{"$ref":"#/definitions/Broadcast"}},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}}},"/broadcast/{broadcastId}":{"put":{"tags":["broadcast"],"summary":"Update an existing broadcas.","description":"Update status an existing broadcast.","operationId":"updateStatusBroadcast","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"},{"name":"broadcastId","in":"path","description":"Identifier of the broadcast that need to be updated.","required":true,"type":"integer"},{"in":"body","name":"body","description":"Broadcast object that needs to be updated to the broadcast","required":false,"schema":{"$ref":"#/definitions/BroadcastUpdate"}}],"responses":{"200":{"description":"Permissions check was successful and the broadcast has been updated.","schema":{"$ref":"#/definitions/Broadcast"}},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}},"get":{"tags":["broadcast"],"summary":"Find Broadcast by broadcastId.","description":"Find Broadcast by broadcastId.","operationId":"getBroadcastById","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"token to be passed as a header.","required":true,"type":"string"},{"name":"broadcastId","in":"path","description":"Identifier of the broadcast.","required":true,"type":"integer"}],"responses":{"200":{"description":"Permissions check was successful and the broadcast has been got.","schema":{"$ref":"#/definitions/Broadcast"}},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}},"delete":{"tags":["broadcast"],"summary":"Delete a broadcast.","description":"Delete a broadcast.","operationId":"deleteBroadcast","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"token to be passed as a header.","required":true,"type":"string"},{"name":"broadcastId","in":"path","description":"Identifier of the broadcast.","required":true,"type":"integer"}],"responses":{"200":{"description":"Permissions check was successful and the broadcast has been deleted."},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}}},"/user/":{"get":{"tags":["user"],"summary":"Get all users.","description":"Get all users. Returns the list of users with which the current user has permission to speak.","operationId":"getListUsers","produces":["application/json"],"parameters":[{"name":"token","in":"header","description":"Token to be passed as a header.","required":true,"type":"string"}],"responses":{"200":{"description":"Permissions check was successful and the list of users has been got.","schema":{"$ref":"#/definitions/User"}},"401":{"description":"Permission failure."},"500":{"description":"Another error occurred."}}}}},"definitions":{"Message":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","description":"Identifier of the message."},"from":{"$ref":"#/definitions/User"},"status":{"type":"string","enum":["Sent","Received","Read"]},"date":{"type":"string","format":"date-time","description":"Date and hour the message was sent."},"message":{"type":"string","description":"The text message."},"conversionId":{"type":"integer","description":"Identifier of the conversation the message belongs to."},"type":{"type":"string","description":"The type of the message.","enum":["Text","Call Start","Call End"]},"edited":{"type":"boolean","description":"To control whether a message has been edited or not."}}},"MessageBody":{"type":"object","properties":{"status":{"type":"string","enum":["Sent","Received","Read"]},"date":{"type":"string","format":"date-time","description":"Date and hour the message was sent."},"message":{"type":"string","description":"The text message."},"type":{"type":"string","description":"The type of the message.","enum":["Text","Call Start","Call End"]}}},"MessageUpdate":{"type":"object","properties":{"message":{"type":"string","description":"The text message."},"status":{"type":"string","description":"Contains a description of the status of the message.","enum":["Sent","Received","Read"]}}},"Conversation":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","description":"Identifier of the conversation."},"users":{"type":"array","description":"List of users involved in the conversation.","items":{"$ref":"#/definitions/User"}},"type":{"type":"string","description":"User-to-user conversation or group.","enum":["usert-to-user","group"]},"lastUpdate":{"type":"string","description":"The date when the conversation was last used.","format":"date-time"},"title":{"type":"string","description":"Title of the conversation."}}},"ConversationBody":{"type":"object","properties":{"users":{"type":"array","description":"List of users involved in the conversation.","items":{"$ref":"#/definitions/User"}},"type":{"type":"string","description":"User-to-user conversation or group.","enum":["usert-to-user","group"]}}},"ConversationUpdate":{"type":"object","properties":{"title":{"type":"string","description":"Title of the conversation."}}},"Broadcast":{"type":"object","required":["broadcastId"],"properties":{"broadcastId":{"type":"integer","description":"Identifier of the broadcast."},"roomId":{"type":"string","description":"The identifier used for the room in the broadcast."},"starter":{"type":"array","description":"List of users who is presenting in the broadcast.","items":{"$ref":"#/definitions/User"}},"status":{"type":"string","description":"Current status of the broadcast: If the presenter is ready or not."},"title":{"type":"string","description":"Title of the broadcast"},"startDate":{"type":"string","description":"The date when the broadcast was started.","format":"date-time"},"endDate":{"type":"string","description":"The date when the broadcast was ended.","format":"date-time"}}},"BroadcastBody":{"type":"object","properties":{"title":{"type":"string","description":"Title of the broadcast"},"startDate":{"type":"string","description":"The date when the broadcast was started.","format":"date-time"}}},"BroadcastUpdate":{"type":"object","properties":{"status":{"type":"string","description":"Current status of the broadcast: If the presenter is ready or not."},"title":{"type":"string","description":"Title of the broadcast"},"endDate":{"type":"string","description":"The date when the broadcast was ended.","format":"date-time"}}},"User":{"type":"object","required":["id"],"properties":{"id":{"type":"integer","description":"Identifier of the user."},"username":{"type":"string","description":"Username of user."},"photo":{"type":"string","description":"User profile photo."},"name":{"type":"string","description":"Name of user."},"specialization":{"type":"string","description":"Specialization of user"},"lastName":{"type":"string","description":"Last name of user."}}}}}