openapi: 3.2.0 info: version: v1.1 title: MTN MADAPI OAuth2 Get access token API description: Generates an access token based on username and password. contact: name: MTN API Support email: developer-support@mtn.com servers: - url: https://api.mtn.com/v1/oauth tags: - name: Get access token paths: /access_token: post: tags: - Get access token summary: Endpoint to request an access token for use in subsequent api calls that require a bearer token in the authorization header. description: OAuth2 endpoint that provides an access token for consumers of other endpoints. parameters: - name: grant_type in: query description: Type of grant i.e client credentials required: true schema: type: string enum: - client_credentials responses: 200: description: Successful token generation. content: application/json: schema: $ref: '#/components/schemas/SuccessToken' 401: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/Unauthorized' 400: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/BadRequest' requestBody: content: application/x-www-form-urlencoded: schema: type: object properties: client_id: type: string description: The client identifier / username. client_secret: type: string description: The client secret / password. components: schemas: SuccessToken: type: object properties: access_token: description: Temporary access token generated by auth API type: string example: Q3C3dhzGxB4I8AZJ6ldPxuSB3Y6o token_type: description: The generated access token type type: string example: bearer expires_in: description: Expiry time for the generated token. type: string example: '3599' refresh_token_expires_in: description: N/A type: string api_product_list: description: N/A type: string api_product_list_json: description: N/A type: string organization_name: description: N/A type: string developer.email: description: N/A type: string issued_at: description: N/A type: string client_id: description: N/A type: string application_name: description: N/A type: string scope: description: N/A type: string refresh_count: description: N/A type: string status: description: N/A type: string BadRequest: type: object properties: error: type: string example: unsupported_grant_type Unauthorized: type: object properties: error: type: string example: invalid_client