openapi: 3.0.1 info: title: Communication Management API description: The Communication Management API provides a standardized mechanism for communication like SMS and email management, such as sending, retrieval, deletion, and notification of events. version: 4.0.0 servers: - url: https://api.ooredoo.com description: Ooredoo API gateway paths: /tmf-api/oauth/v4/token: post: summary: Generate Access Token description: Token generation endpoint (client_id & client_secret in headers, grant_type in body) parameters: - name: client_id in: header required: true description: Client ID of onboarded client. schema: type: string format: password default: 67Q4itU3ivApTHRB4dJKFh4R5UAdG5RAsMeEq2NppNgd6LBH - name: client_secret in: header required: true description: Client secret of onboarded client. schema: type: string format: password default: yp1CUQyGwEMNruGXtnhIbpTOuK6BGlxAFmiGlG2FQea3cHgaVqRw7rybKnWAUeKB requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: grant_type: type: string default: client_credentials description: OAuth grant type required: - grant_type responses: '200': description: Successful token response content: application/json: schema: type: object properties: access_token: type: string token_type: type: string expires_in: type: integer consented_on: type: string created_At: type: string expired_At: type: string "401": description: Unauthorized content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' /tmf-api/communicationManagement/v4/communicationMessage: post: summary: Creates a CommunicationMessage description: This operation creates a CommunicationMessage entity. operationId: createCommunicationMessage parameters: - name: countryCode in: header description: countryCode informartion required: true schema: type: string default: MDV - name: transactionId in: header description: transactionId informartion required: true schema: type: string default: 342716534271653427165 requestBody: description: The CommunicationMessage to be created content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/CommunicationMessage_Create' required: true responses: "201": description: Created content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/CommunicationMessage' "400": description: Bad Request content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' "401": description: Unauthorized content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' "403": description: Forbidden content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' "405": description: Method Not allowed content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' "409": description: Conflict content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' "500": description: Internal Server Error content: application/json;charset=utf-8: schema: $ref: '#/components/schemas/Error' x-codegen-request-body-name: communicationMessage security: - BearerAuth: [] components: schemas: Any: type: object Attachment: type: object properties: id: type: string description: Unique identifier for this particular attachment href: type: string description: URI for this Attachment attachmentType: type: string description: "Attachment type such as video, picture" content: type: string description: "The actual contents of the attachment object, if embedded,\ \ encoded as base64" description: type: string description: A narrative text describing the content of the attachment mimeType: type: string description: "Attachment mime type such as extension file for video, picture\ \ and document" name: type: string description: The name of the attachment url: type: string description: "Uniform Resource Locator, is a web page address (a subset\ \ of URI)" size: $ref: '#/components/schemas/Quantity' validFor: $ref: '#/components/schemas/TimePeriod' '@baseType': type: string description: "When sub-classing, this defines the super-class" '@schemaLocation': type: string description: A URI to a JSON-Schema file that defines additional attributes and relationships format: uri '@type': type: string description: "When sub-classing, this defines the sub-class entity name" description: "Complements the description of an element (for instance a product)\ \ through video, pictures..." Characteristic: required: - name - value type: object properties: id: type: string description: Unique identifier of the characteristic name: type: string description: Name of the characteristic valueType: type: string description: Data type of the value of the characteristic characteristicRelationship: type: array items: $ref: '#/components/schemas/CharacteristicRelationship' value: $ref: '#/components/schemas/Any' '@baseType': type: string description: "When sub-classing, this defines the super-class" '@schemaLocation': type: string description: A URI to a JSON-Schema file that defines additional attributes and relationships format: uri '@type': type: string description: "When sub-classing, this defines the sub-class entity name" description: Describes a given characteristic of an object or entity through a name/value pair. CharacteristicRelationship: type: object properties: id: type: string description: Unique identifier of the characteristic relationshipType: type: string description: The type of relationship '@baseType': type: string description: "When sub-classing, this defines the super-class" '@schemaLocation': type: string description: A URI to a JSON-Schema file that defines additional attributes and relationships format: uri '@type': type: string description: "When sub-classing, this defines the sub-class entity name" description: Another Characteristic that is related to the current Characteristic; CommunicationMessage: type: object properties: name: type: string description: Unique name for the sender content: type: string description: The content of the communication message description: type: string description: Description for the whole object messageType: type: string description: "The type of message, such as: SMS, Email, Mobile app push\ \ notification" priority: type: string description: |- The priority of the communication message. Small number means higher priority. subject: type: string description: "The title of the message, necessary for the email and mobile app push" receiver: type: array description: The receiver(s) of this message items: $ref: '#/components/schemas/Receiver' sender: $ref: '#/components/schemas/Sender' state: $ref: '#/components/schemas/CommunicationMessageStateType' '@baseType': type: string description: "When sub-classing, this defines the super-class" '@type': type: string description: "When sub-classing, this defines the sub-class entity name" description: "The message can reach the customer in different interaction channels, including: email, short message, mobile app notification (push)." CommunicationMessage_Create: required: - content - messageType - receiver - sender type: object properties: content: type: string description: The content of the communication message example: Dear Karti, Here is the information of the promotion messageType: type: string description: "The type of message, such as: SMS, Email" example: sms receiver: minItems: 1 type: array description: The receiver(s) of this message items: $ref: '#/components/schemas/Receiver' sender: $ref: '#/components/schemas/Sender' description: |- The message can reach the customer in different interaction channels, including: email, short message, mobile app notification (push). CommunicationMessageStateType: type: string description: Communication message state type enum: - initial - inProgress - completed - cancelled - failed Quantity: type: object properties: amount: type: number description: Numeric value in a given unit format: float default: 1.0 units: type: string description: Unit description: An amount in a given unit Receiver: type: object properties: phoneNumber: type: string description: "Phone number of the receiver, if the communication type is SMS." example: 9609612198 description: Receivers of the communication message. Sender: required: - name type: object properties: name: type: string description: ID of the sender example: Karti TimePeriod: type: object properties: endDateTime: type: string description: "End of the time period, using IETC-RFC-3339 format" format: date-time startDateTime: type: string description: "Start of the time period, using IETC-RFC-3339 format." format: date-time description: "A period of time, either as a deadline (endDateTime only) a startDateTime only, or both" Error: required: - code - reason type: object properties: code: type: string description: "Application relevant detail, defined in the API or a common list." reason: type: string description: Explanation of the reason for the error which can be shown to a client user. message: type: string description: More details and corrective actions related to the error which can be shown to a client user. status: type: string description: HTTP Error code extension '@type': type: string description: "When sub-classing, this defines the sub-class entity name." description: "Used when an API throws an Error, typically with a HTTP error response-code (3xx, 4xx, 5xx)" securitySchemes: BearerAuth: type: http name: Authorization in: header scheme: bearer bearerFormat: JWT x-original-swagger-version: "2.0"