{
  "info": {
    "title": "Inquire SIM Status",
    "version": "4.0.0",
    "description": "Resource Inventory  API goal is to retrieves the status of the SIM identified by the serial number. (TMF 639)"
  },
  "tags": [
    {
      "name": "resource"
    },
    {
      "name": "notification listeners (client side)"
    },
    {
      "name": "events subscription"
    }
  ],
  "paths": {
    "/healthz": {
      "get": {
        "summary": "This resource helps us to give health of an application",
        "responses": {
          "200": {
            "description": "This resource helps us to give health of an application"
          }
        },
        "x-page-slug": "healthz"
      }
    },
    "/resource/{id}": {
      "get": {
        "summary": "Inquire SIM Status",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/simResponse"
                },
                "example": {
                  "id": "",
                  "href": "",
                  "@type": "Sim",
                  "reclaimId": "  N",
                  "returnCode": "SIM0002",
                  "resourceStatus": "U"
                }
              }
            },
            "description": "Success"
          },
          "400": {
            "content": {
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "content": {
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "error": "Forbidden",
                  "status": "Failure",
                  "message": "Forbidden"
                }
              },
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "error": "Resource Not Found",
                  "status": "Failure",
                  "message": "Resource not found"
                }
              },
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not Found"
          },
          "405": {
            "content": {
              "application/json": {
                "example": {
                  "error": "Method Not Allowed",
                  "status": "Failure",
                  "message": "Method not allowed / implemented"
                }
              },
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Method Not allowed"
          },
          "406": {
            "$ref": "#/components/responses/trait_ErrorResponses_406"
          },
          "409": {
            "content": {
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Conflict"
          },
          "415": {
            "$ref": "#/components/responses/trait_ErrorResponses_415"
          },
          "500": {
            "content": {
              "application/json": {
                "example": {
                  "error": "Internal Server Error",
                  "status": "Failure",
                  "message": "Internal Server Error"
                }
              },
              "application/json;charset=utf-8": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Internal Server Error"
          },
          "503": {
            "$ref": "#/components/responses/trait_jwt_503"
          }
        },
        "parameters": [
          {
            "name": "@type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "Sim"
              ]
            },
            "description": "Identifier of the type of Resource (Sim)"
          },
          {
            "$ref": "#/components/parameters/trait_jwt_Authorization"
          },
          {
            "$ref": "#/components/parameters/trait_headers_x-att-clientId"
          },
          {
            "$ref": "#/components/parameters/trait_headers_x-att-conversationId"
          },
          {
            "$ref": "#/components/parameters/trait_headers_x-att-correlationId"
          }
        ],
        "x-page-slug": "inquire-sim-status",
        "description": "This operation retrieves the status of the SIM identified by the serial number. (TMF 639)",
        "operationId": "TMF639-ResourceInventiry-SimStatus"
      },
      "parameters": [
        {
          "in": "path",
          "required": true,
          "name": "id",
          "schema": {
            "type": "string",
            "maxLength": 20,
            "minLength": 18,
            "pattern": "^[0-9]+$"
          },
          "description": "Identifier of the Resource (SIM Serial Number) or ICCID"
        }
      ]
    }
  },
  "openapi": "3.0.3",
  "components": {
    "links": {},
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "code",
          "reason"
        ],
        "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."
          },
          "status": {
            "type": "string",
            "description": "HTTP Error code extension"
          },
          "message": {
            "type": "string",
            "description": "More details and corrective actions related to the error which can be shown to a client user."
          },
          "referenceError": {
            "type": "string"
          }
        }
      },
      "healthCheck": {
        "type": "object",
        "required": [
          "application_name",
          "message",
          "time"
        ],
        "properties": {
          "time": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "application_name": {
            "type": "string"
          }
        }
      },
      "simResponse": {
        "type": "object",
        "required": [
          "id",
          "href",
          "resourceStatus",
          "returnCode",
          "reclaimId"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": " This is the ICCID"
          },
          "href": {
            "type": "string",
            "description": "reference of the service"
          },
          "reclaimId": {
            "type": "string",
            "description": "SIM reclaim id"
          },
          "returnCode": {
            "type": "string",
            "description": "The SIM status return code returned from NSM: Empty tag - Success:  SIM is available for activation; SIM0001 - Sim is not loaded; SIM0002 - Sim is unavailable/in use; SIM0003 - Sim is permanently disabled; SIM0005 - Sim is disconnected; SIM0012 - Invalid market; SIM0099 - Database error."
          },
          "resourceStatus": {
            "type": "string",
            "enum": [
              "A",
              "R",
              "L",
              "U",
              "G",
              "Z"
            ],
            "description": "The possible SIM statuses are A, R, L, U, G, Z.  Status A represents the SIM is valid and all the remaining statuses represent the SIM is invalid.  A - Success: SIM is available for activation; R - Error: Sim is not loaded yet; L - Error: Sim is not loaded yet; U - Error: Sim is in use; G - Error: Sim is disconnected; Z - Error: Sim is disabled."
          }
        }
      }
    },
    "headers": {},
    "examples": {},
    "responses": {
      "trait_jwt_400": {
        "description": "JWT Token is required."
      },
      "trait_jwt_401": {
        "description": "Invalid token."
      },
      "trait_jwt_503": {
        "description": "Error communicating with JWKS server"
      },
      "trait_ErrorResponses_400": {
        "content": {
          "application/json": {
            "example": {
              "error": "Bad Request",
              "status": "Failure",
              "message": "Required Key not Found"
            }
          }
        },
        "description": "The Server will not process the request due to something that is perceived to be a client error(e.x.,malformed request syntax|invalid request message framing|deceptive request routing)."
      },
      "trait_ErrorResponses_401": {
        "content": {
          "application/json": {
            "example": {
              "error": "Unauthorized",
              "status": "Failure",
              "message": "Not Authorized"
            }
          }
        },
        "description": "The supplied credentials are not valid."
      },
      "trait_ErrorResponses_403": {
        "content": {
          "application/json": {
            "example": {
              "error": "Forbidden",
              "status": "Failure",
              "message": "Forbidden"
            }
          }
        },
        "description": "There is a problem with the credentials that were provided."
      },
      "trait_ErrorResponses_404": {
        "content": {
          "application/json": {
            "example": {
              "error": "Resource Not Found",
              "status": "Failure",
              "message": "Resource not found"
            }
          }
        },
        "description": "The server cannot find the requested resource."
      },
      "trait_ErrorResponses_405": {
        "content": {
          "application/json": {
            "example": {
              "error": "Method Not Allowed",
              "status": "Failure",
              "message": "Method not allowed / implemented"
            }
          }
        },
        "description": "A request was made of a resource using a request method not supported by that resource;for example(using GET on a form which requires data to be presented via POST(or) using PUT on a read only resource)."
      },
      "trait_ErrorResponses_406": {
        "content": {
          "application/json": {
            "example": {
              "error": "Not Acceptable",
              "status": "Failure",
              "message": "Not Acceptable"
            }
          }
        },
        "description": "The target resource does not have a current representation that would be acceptable to the user agent."
      },
      "trait_ErrorResponses_415": {
        "content": {
          "application/json": {
            "example": {
              "error": "Unsupported Media Type",
              "status": "Failure",
              "message": "Unsupported Media Type"
            }
          }
        },
        "description": "The Content-Type specified in the header was unsupported media type."
      },
      "trait_ErrorResponses_500": {
        "content": {
          "application/json": {
            "example": {
              "error": "Internal Server Error",
              "status": "Failure",
              "message": "Internal Server Error"
            }
          }
        },
        "description": "An internal processing error occured while processing the API Request."
      },
      "securityScheme_ATT_Azure_AD_JWT_Token_200": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "token_type",
                "expires_in",
                "ext_expires_in",
                "access_token"
              ],
              "properties": {
                "token_type": {
                  "type": "string",
                  "example": "Bearer",
                  "default": "Bearer"
                },
                "expires_in": {
                  "type": "integer",
                  "format": "int32",
                  "example": 3599
                },
                "access_token": {
                  "type": "string",
                  "example": ""
                },
                "ext_expires_in": {
                  "type": "integer",
                  "format": "int32",
                  "example": 3599
                }
              }
            }
          }
        },
        "description": "No description provided"
      },
      "securityScheme_ATT_Azure_AD_JWT_Token_400": {
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error",
                "error_description",
                "error_codes",
                "timestamp",
                "trace_id",
                "correlation_id",
                "error_uri"
              ],
              "properties": {
                "error": {
                  "type": "string",
                  "example": "unauthorized_client"
                },
                "trace_id": {
                  "type": "string",
                  "example": ""
                },
                "timestamp": {
                  "type": "string",
                  "example": ""
                },
                "error_uri": {
                  "type": "string",
                  "example": ""
                },
                "error_codes": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "format": "int32",
                    "example": 700016
                  }
                },
                "correlation_id": {
                  "type": "string",
                  "example": ""
                },
                "error_description": {
                  "type": "string",
                  "example": "AADSTS700016: Application with identifier '6bb2748d-d916-4534-9145-ee8f598d2e01' was not found in the directory 'e741d71c-c6b6-47b0-803c-0f3b32b07556'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.\\r\\nTrace ID: b82bea2f-5ee3-48a4-9774-4143176a6900\\r\\nCorrelation ID: b57403ef-e775-49f6-b40f-009ba759c301\\r\\nTimestamp: 2021-06-30 21:12:34Z"
                }
              }
            }
          }
        },
        "description": "No description provided"
      }
    },
    "callbacks": {},
    "parameters": {
      "trait_jwt_Authorization": {
        "in": "header",
        "name": "Authorization",
        "schema": {
          "type": "string"
        },
        "required": true,
        "description": "id/secret are not the right ones - contact API provider, via 'Request Access' button to get the correct on"
      },
      "trait_headers_x-att-clientId": {
        "in": "header",
        "name": "x-att-clientId",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "trait_headers_x-att-correlationId": {
        "in": "header",
        "name": "x-att-correlationId",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "trait_headers_x-att-conversationId": {
        "in": "header",
        "name": "x-att-conversationId",
        "schema": {
          "type": "string"
        },
        "required": false
      },
      "securityScheme_ATT_Azure_AD_JWT_Token_Authorization": {
        "in": "header",
        "name": "Authorization",
        "schema": {
          "type": "string"
        },
        "example": "",
        "required": true,
        "description": "JWT Bearer Token"
      }
    },
    "requestBodies": {},
    "securitySchemes": {
      "ATT_Azure_AD_JWT_Token": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "scopes": {},
            "tokenUrl": "",
            "authorizationUrl": ""
          }
        },
        "description": "Get a JWT Token from AT&T's Azure AD"
      }
    }
  }
}