{
  "swagger": "2.0",
  "info": {
    "title": "3-legged sandbox FR API",
    "version": "1.0",
    "description": "Unless otherwise specified, the 3-legged API endpoints require a user authentication. This means you must provide a bearer  Authorization header with a valid access token for each API call. For the authorize step, the scope parameter must contain the values openid, profile, address, phone, and email . Scopes address, phone and email require a specific authorization from Orange."
  },
  "host": "api.orange.com",
  "schemes": [
    "https"
  ],
  "basePath": "/3legged/sandbox/fr/v1",
  "produces": [
    "application/json"
  ],
  "paths": {
    "/userinfo": {
      "get": {
        "tags": [
          "user details"
        ],
        "parameters": [
          {
            "$ref": "#/parameters/authenticationToken"
          }
        ],
        "description": "To invoke the 3-legged sandbox API, you need to provide the obtained \"access token\".",
        "responses": {
          "200": {
            "description": "Successful response",
            "schema": {
              "$ref": "#/definitions/user_details_def"
            }
          },
          "400": {
            "description": "List of error codes: <br/>- <u>invalid_request</u>: the request is missing a required parameter, includes an unsupported parameter or parameter value, repeats the same parameter, uses more than one method for including an access token.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          },
          "401": {
            "description": "List of error codes: <br/>- <u>invalid_token</u>: the access token provided is expired, revoked, malformed, or invalid for other reasons.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          },
          "403": {
            "description": "List of error codes: <br/>- <u>insufficient_scope</u>: the request requires higher privileges than provided by the access token.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          },
          "404": {
            "description": "List of error codes: <br/>- <u>invalid_request</u>: the requested URI or the requested resource does not exist.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          },
          "405": {
            "description": "List of error codes: <br/>- <u>invalid_request</u>: the URI does not support the requested method.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          },
          "500": {
            "description": "List of error codes: <br/>- <u>server_error</u>: the userinfo endpoint encountered an unexpected condition that prevented it from fulfilling the request.",
            "schema": {
              "$ref": "#/definitions/oidc_error_def"
            }
          }
        },
        "security": [
          {
            "user_auth": []
          }
        ]
      }
    }
  },
  "definitions": {
    "user_details_def": {
      "type": "object",
      "description": "User's attributes + alias (sub)",
      "properties": {
        "sub": {
          "type": "string",
          "description": "Identifier of the end-user"
        },
        "name": {
          "type": "string",
          "description": "Contains the declarative complete name (first + last name) of the end-user"
        },
        "family_name": {
          "type": "string",
          "description": "Contains the last name of the end-user"
        },
        "given_name": {
          "type": "string",
          "description": "Contains the first name of the end-user"
        },
        "email": {
          "type": "string",
          "description": "Contains the email address of the end-user"
        },
        "phone_number": {
          "type": "string",
          "description": "Contains the phone number of the end-user"
        },
        "formatted": {
          "type": "string",
          "description": "Contains the complete formatted address of the end-user"
        },
        "locality": {
          "type": "string",
          "description": "Contains the locality of the end-user"
        },
        "street_address": {
          "type": "string",
          "description": "Contains the street address of the end-user"
        },
        "postal_code": {
          "type": "string",
          "description": "Contains the postal code of the end-user"
        },
        "country": {
          "type": "string",
          "description": "Contains the country name of the end-user"
        },
        "updated_at": {
          "type": "string",
          "description": "Contains the last date whhen customer data was updated"
        },
        "subscriber_msisdn": {
          "type": "string",
          "description": "Contains the MSISDN of the end-user"
        },
        "locale": {
          "type": "string",
          "description": "Contains the preferred language of the end-user"
        },
        "gender": {
          "type": "string",
          "description": "Contains the gender type of the end-user"
        },
        "birthdate": {
          "type": "string",
          "description": "Contains the birth date of the end-user"
        }
      }
    },
    "oidc_error_def": {
      "type": "object",
      "description": "Error response for UserInfo request",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "description": "A single ASCII error code (e.g. invalid_token).",
          "type": "string"
        },
        "error_description": {
          "description": "Human-readable ASCII text providing additional information about the error (e.g. no consent has been found). ",
          "type": "string"
        }
      }
    }
  },
  "parameters": {
    "authenticationToken": {
      "name": "Authorization",
      "in": "header",
      "type": "string",
      "pattern": "Bearer .+",
      "description": "The Authorization with a valid token",
      "required": true
    },
    "jsonp": {
      "name": "_jsonp",
      "in": "query",
      "description": "JSONP function name",
      "required": false,
      "type": "string"
    }
  },
  "securityDefinitions": {
    "user_auth": {
      "type": "oauth2",
      "description": "The 3-legs authentication",
      "flow": "accessCode",
      "authorizationUrl": "https://api.orange.com/openidconnect/fr/v1/authorize",
      "tokenUrl": "https://api.orange.com/openidconnect/fr/v1/token",
      "scopes": {
        "openid": "scope to request an ID token and get User identifier for SSO",
        "profile_sandbox": "scope to request authorization to access user profile data (3-legged sandbox API)"
      }
    }
  }
}