openapi: 3.0.3 info: description: | This API allows API consumers to check status of device swapping. # Introduction This API lets API Consumers to check if customer has changed his device in last specified days (e.g. in last 30 days). It provides the customer with the ability to understand if the MSISDN (mobile number) has had a change of device in the the specified number of days. # API resources # Further info and support (FAQs will be added in a later version of the documentation) version: 1.0.0 title: Device Swap Status API termsOfService: https://api.omantel.om/docs/terms/ contact: email: MiddlewareESB@omantel.om license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html externalDocs: description: Product documentation at https://developer.omantel.om/ url: https://developer.omantel.om/ servers: - url: https://apigwsb.omantel.om variables: apiRoot: default: https://apigwsb.omantel.om description: API root basePath: default: /device-swap/v1 description: Base path for the device swap API tags: - name: Device swap status description: Operations to check whether device is swapped or not during specified number of days paths: /device-swap/v1/status/{mobileNumber}: get: security: - oAuth2ClientCredentials: [] tags: - Device swap status summary: Check whether device is swapped or not operationId: deviceSwapStatus description: | Returns Device swap status `true` or `false`. If device was changed withing these specified last days (default last 30 days), it will return `true`, and if device was not changed, it will return `false`. parameters: - name: mock-key in: query description: The mock-key parameter is used to simulate different response scenarios. Choose one of the available keys. **NOTE:- Mock keys are only applicable for sandbox environment and only give you mock responses.** required: true schema: type: string enum: - device-swap-info-get-200 - device-swap-info-get-400 - device-swap-info-get-401 - device-swap-info-get-403 - device-swap-info-get-404 - device-swap-info-get-500 - device-swap-info-get-502 - device-swap-info-get-503 - device-swap-info-get-504 - name: mobileNumber in: path description: Mobile number of Omantel customer with or without country code. example: 9250xxxx required: true schema: type: string - name: days in: query description: | Last number of days in which device swap should be checked. Default value is last 30 days. For example, if 30 days are specified, the API will return `true` if the device swap was done in last 30 days, `false` otherwise. example: 30 required: false schema: type: integer minimum: 7 maximum: 90 example: 30 responses: 200: description: OK content: application/json: schema: type: object properties: device-swapped: type: boolean example: true description: Returns `true` if device was swapped within these days, `false` otherwise. 401: $ref: "#/components/responses/Generic401" 403: $ref: "#/components/responses/Generic403" 404: $ref: "#/components/responses/Generic404" 500: $ref: "#/components/responses/Generic500" 503: $ref: "#/components/responses/Generic503" 504: $ref: "#/components/responses/Generic504" components: schemas: ErrorInfo: type: object required: - code - message - status properties: code: type: string description: Code given to this error status: type: string description: HTTP response status code message: type: string description: Detailed error description responses: Generic400: description: Invalid input content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: INVALID_ARGUMENT status: 400 message: "Schema validation failed at ..." Generic401: description: Unauthorized content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: UNAUTHORIZED status: 401 message: "Authorization failed: ..." Generic403: description: Forbidden content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: FORBIDDEN status: 403 message: "Operation not allowed: ..." Generic404: description: Customer Not Found - check if specified mobile number is a valid Omantel customer content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: NOT_FOUND status: 404 message: "The specified mobile number is not found" Generic409: description: Conflict content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: status: 409 code: ALREADY_EXISTS message: "A specified resource duplicate entry found" Generic500: description: Server error content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: SERVER_ERROR status: 500 message: "Server Error" Generic503: description: Service unavailable content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: SERVICE_UNAVAILABLE status: 503 message: "Service unavailable" Generic504: description: Request timeout exceeded content: application/json: schema: $ref: "#/components/schemas/ErrorInfo" example: code: REQUEST_TIMEOUT_EXCEEDED status: 504 message: "Request timeout exceeded" securitySchemes: oAuth2ClientCredentials: type: oauth2 flows: clientCredentials: tokenUrl: https://apigwsb.omantel.om/oauth2/accesstoken scopes: {}