{
    "swagger":"2.0",
    "info":{
        "description":"The REST API for Self-Management provides the ability to view the authenticated user details in Oracle Content Management.\n\n<p>Last updated: August 2022.</p>",
        "version":"2022.08.10",
        "title":"REST API for Self-Management",
        "x-summary":"The REST API for Self-Management provides the ability to view the authenticated user details in Oracle Content Management."
    },
    "basePath":"/system/api/v1",
    "tags":[
        {
            "name":"Self-Management",
            "description":"Self-Management endpoint for authenticated users."
        }
    ],
    "schemes":[
        "https"
    ],
    "paths":{
        "/me":{
            "get":{
                "tags":[
                    "Self-Management"
                ],
                "summary":"Get details about authenticated user",
                "description":"Get the details about authenticated user from Identity Provider(IdP). \n\n ## Authorization   \n Authenticated user can request the details from IdP.",
                "operationId":"selfmanagement",
                "consumes":[
                    "application/json"
                ],
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "name":"customAttributes",
                        "in":"query",
                        "description":"The comma-seperated and case-insensitive strings that specifies the names of IDCS custom attributes that should be returned in the UserInfo response. By default, a response will contain only few predefined User's attributes. If a request specifies this query parameter, the response includes the attributes that this query parameter specifies along with the predefined User's attributes. Maximum number of custom attributes allowed in the query parameters is 20.",
                        "type":"String",
                        "required":false
                    },
                    {
                        "name":"includeGroupMembership",
                        "in":"query",
                        "description":"A boolean query parameter, which when set to true, include all the IDCS groups(Group's DisplayName and GUID) the user is part of, in the response.",
                        "type":"boolean",
                        "required":false
                    },
                    {
                        "name":"includeIDCSAppRoles",
                        "in":"query",
                        "description":"A boolean query parameter, which when set to true, includes all the service specific IDCS Application roles the user is assigned to, in the response.",
                        "type":"boolean",
                        "required":false
                    },
                    {
                        "name":"includeRealmUserGUID",
                        "in":"query",
                        "description":"A boolean query parameter, which when set to true, include user's GUID from Realm in the response.",
                        "type":"boolean",
                        "required":false
                    }
                ],
                "responses":{
                    "200":{
                        "description":"OK",
                        "schema":{
                            "$ref":"#/definitions/UserInfo"
                        }
                    },
                    "304":{
                        "description":"Not Modified",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    },
                    "400":{
                        "description":"Bad Request",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    },
                    "404":{
                        "description":"Not Found",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    },
                    "500":{
                        "description":"Internal Server Error",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    }
                },
                "x-internal-id":"me-get",
                "x-filename-id":"me-get"
            }
        },
        "/security/token":{
            "post":{
                "tags":[
                    "Self-Management"
                ],
                "summary":"Get access token for authenticated user",
                "description":"This call can be made with basic authorization. This end point can not be used to get token for client applications.",
                "operationId":"accessToken",
                "consumes":[
                    "application/json"
                ],
                "produces":[
                    "application/json"
                ],
                "parameters":[
                    {
                        "name":"V1AuthTokenRequestInfo",
                        "in":"body",
                        "required":false,
                        "description":"The request body defines the details of the request.",
                        "schema":{
                            "$ref":"#/definitions/V1AuthTokenRequestInfo"
                        }
                    }
                ],
                "responses":{
                    "200":{
                        "description":"OK",
                        "schema":{
                            "$ref":"#/definitions/AuthToken"
                        }
                    },
                    "400":{
                        "description":"Illegal Argument",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    },
                    "403":{
                        "description":"Forbidden",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    },
                    "500":{
                        "description":"Internal Server Error",
                        "schema":{
                            "$ref":"#/definitions/ExceptionDetail"
                        }
                    }
                },
                "x-internal-id":"security-token-post",
                "x-filename-id":"security-token-post"
            }
        }
    },
    "definitions":{
        "UserInfo":{
            "type":"object",
            "properties":{
                "realmUserGUID":{
                    "type":"string",
                    "example":"26e1a1b236b8415e97f1b44a60639ba8",
                    "description":"User's GUID from realm"
                },
                "userName":{
                    "type":"string",
                    "example":"joe@example.com",
                    "description":"User name."
                },
                "firstName":{
                    "type":"string",
                    "example":"Joe",
                    "description":"User's first name."
                },
                "middleName":{
                    "type":"string",
                    "example":"Jane",
                    "description":"User's middle name."
                },
                "lastName":{
                    "type":"string",
                    "example":"Janesen",
                    "description":"User's last name."
                },
                "email":{
                    "type":"string",
                    "example":"joe@example.com",
                    "description":"User's primary email address."
                },
                "locale":{
                    "type":"string",
                    "example":"en",
                    "description":"User's locale."
                },
                "timezone":{
                    "type":"string",
                    "example":"America/Los_Angeles",
                    "description":"User's timezone."
                },
                "links":{
                    "type":"array",
                    "description":"Link to related resources and actions or actions on this resource. Must include at least a 'self' link that contains a link to the canonical representation of the resource.",
                    "items":{
                        "$ref":"#/definitions/Link"
                    }
                },
                "customAttributes":{
                    "type":"object",
                    "description":"Object containing specified custom attributes and their values."
                },
                "membershipGroupsList":{
                    "type":"array",
                    "items":{
                        "$ref":"#/definitions/Group"
                    },
                    "description":"Array of IDCS groups the user is part of. Each group entry contains group's DisplayName and it's IDCS ID."
                },
                "idcsappRoles":{
                    "type":"array",
                    "items":{
                        "type":"string"
                    },
                    "description":"Array of IDCS Application roles, the user is part of."
                }
            },
            "description":"Self-Management details.",
            "required":[
                "userName",
                "lastName",
                "email",
                "links"
            ]
        },
        "AuthToken":{
            "type":"object",
            "properties":{
                "tokenType":{
                    "type":"string",
                    "example":"Bearer",
                    "description":"Access token type."
                },
                "accessToken":{
                    "type":"string",
                    "description":"Access token."
                },
                "refreshToken":{
                    "type":"string",
                    "description":"Refresh token."
                },
                "expiresInMillis":{
                    "type":"integer",
                    "format":"int64",
                    "example":"1209600000",
                    "description":"Access token duration(in ms)."
                }
            },
            "description":"Auth token details."
        },
        "V1AuthTokenRequestInfo":{
            "type":"object",
            "properties":{
                "refreshToken":{
                    "type":"string",
                    "description":"If specified, access token will be obtained for specified refresh token. Else access token will be obtained for authenticated user.",
                    "required":false
                }
            }
        },
        "Link":{
            "type":"object",
            "properties":{
                "rel":{
                    "type":"string",
                    "description":"Link relation. Name of the link relation that, in addition to the type property, can be used to retrieve link details."
                },
                "href":{
                    "type":"string",
                    "description":"The target resource URI. URI *RFC3986* or URI Template *RFC6570*. If the value is set to URI Template, then the `templated` property must be set to `true`."
                },
                "templated":{
                    "type":"boolean",
                    "description":"Link href template flag. Boolean flag that specifies the `href` property is a URI or URI Template. The property can be assumed to be `false` if the property is not present."
                },
                "mediaType":{
                    "type":"string",
                    "description":"Link target. Media type, as defined by RFC 2046, describing the link target."
                },
                "method":{
                    "type":"string",
                    "description":"Link target HTTP method. HTTP method for requesting the target of the link.  *  `none` - Indicates no valid HTTP method *  `OPTIONS` - HTTP OPTIONS *  `HEAD` - HTTP HEAD *  `GET` - HTTP GET *  `POST` - HTTP POST *  `PUT` - HTTP PUT *  `PATCH` - HTTP PATCH *  `DELETE` - HTTP DELETE"
                },
                "profile":{
                    "type":"string",
                    "description":"Link meta data location. Link to the metadata of the resource, such as JSON-schema, that describes the resource expected when dereferencing the target resource."
                }
            },
            "description":"REST link and related meta data.  If responses provide links (e.g. a `self` link to the resource itself) the links provided will include one or more of the properties defined on this link structure."
        },
        "Group":{
            "type":"object",
            "properties":{
                "DisplayName":{
                    "type":"string",
                    "description":"IDCS group's displayName."
                },
                "ID":{
                    "type":"string",
                    "description":"IDCS group's ID."
                }
            },
            "required":[
                "DisplayName",
                "ID"
            ],
            "description":"IDCS group, the user is part of."
        },
        "ExceptionDetail":{
            "type":"object",
            "properties":{
                "type":{
                    "type":"string",
                    "description":"Absolute URI that identifies the problem type. When this URI dereferenced, it **should** provide a human-readable summary of the problem, for example, as a HTML page."
                },
                "title":{
                    "type":"string",
                    "description":"Short, human-readable summary of the problem. The summary **should not** change for subsequent occurrences of the problem, except for purposes of localization."
                },
                "status":{
                    "type":"integer",
                    "format":"int32",
                    "description":"HTTP status code. The corresponding HTTP status code for the exception. For exception that includes a resource does not exist would have a HTTP status of `404`."
                },
                "detail":{
                    "type":"string",
                    "description":"Description specific to this occurrence of the problem. The human readable, potentially multi-line details describing the problem in more details."
                },
                "instance":{
                    "type":"string",
                    "description":"URI to the link that provides more detail about the error."
                },
                "o:errorCode":{
                    "type":"string",
                    "description":"Application error code, which is different from HTTP error code."
                },
                "o:errorPath":{
                    "type":"string",
                    "description":"XPath or JSON path to indicate where the error occurs."
                },
                "o:errorDetails":{
                    "type":"array",
                    "description":"Multiple errors can be organized in a hierarchical structure.",
                    "items":{
                        "$ref":"#/definitions/ExceptionDetail"
                    }
                }
            },
            "description":"Error details for a REST request.  In addition to HTTP error code and error messages, it is often desirable to provide additional information to the client when a request fails. In such these cases, the additional information must be included in the error response body. The additional information is optional, but if provided, it will be in the form of exception detail."
        }
    }
}