Get Loggedin User Using GET

Get Loggedin User Using GET

Get principal user information.
Principal user is identified via a token. The token should be passed in a header called csp-auth-token.If expandProfile is passed in the request user profile information will be also returned.

Access Policy

Role User Accounts Service Accounts (Client Credentials Applications)
All Roles ✔️
Request
URI
GET
https://{api_host}/csp/gateway/am/api/loggedin/user
COPY
Query Parameters
string
expand
Optional

Indicates if response should be expanded, value is ignored - only the existence of parameter is checked. Includes the address details of the user only if the user is non-federated(vmwareid). If the user is federated, this flag is ignored.

string
expandProfile
Optional

Indicates if the response should be expanded with the user profile; the value is ignored, only the existence of parameter is checked. Includes the profile details of the user in the userProfile attribute. This userProfile attribute consists of the same output as calling "/am/api/loggedin/user/profile".


Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns UserDto of type(s) application/json
{
    "eulaInfo": "string",
    "tnc": false,
    "customerNumber": "string",
    "userProfile": {
        "isFederated": false,
        "linkedUserIdAccount": "string",
        "alternativeEmail": "string",
        "language": "string",
        "locale": "string",
        "defaultOrgId": "string",
        "customerNumber": "string"
    },
    "userId": "string",
    "refLink": "string",
    "country": "string",
    "state": "string",
    "email": "string",
    "city": "string",
    "firstName": "string",
    "acct": "string",
    "lastName": "string",
    "address": "string",
    "password": "string",
    "stateName": "string",
    "stateCode": "string",
    "username": "string",
    "countryName": "string",
    "countryCode": "string",
    "zipcode": "string",
    "tradeId": "string",
    "company": "string",
    "workPhone": "string",
    "website": "string",
    "emailVerified": false
}
string
eulaInfo
Optional

The end-user license agreement information.

boolean
tnc
Optional

Terms and conditions.

string
customerNumber
Optional

The customer number.

object
userProfile
Optional

Define user profile with default organization, locale and language.

string
userId
Optional

The unique identifier of the user, on behalf of which the token was issued.

string
refLink
Optional

The reference link to the user profile.

string
country
Required

The country.

string
state
Optional

The user's state.

string
email
Optional

The email address of the user.

string
city
Required

The city.

string
firstName
Required

The first name of the user.

string
acct
Optional

The identifier of the user, configured to log in to the Identity provider.

string
lastName
Required

The last name of the user.

string
address
Required

The address.

string
password
Required

The password. Combination of characters, numbers and special symbols that is hard to guess.

string
stateName
Optional

The user's state name.

string
stateCode
Optional

The user's state code.

string As email As (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
username
Required

The username of the user.

string
countryName
Optional

The country name.

string
countryCode
Optional

The country code.

string
zipcode
Required

The ZIP code.

string
tradeId
Optional

The trade ID.

string
company
Required

The company.

string
workPhone
Required

The work phone number.

string
website
Optional

The web site.

boolean
emailVerified
Optional

True if the user's e-mail address has been verified.


401

The user is not authorized to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


403

The user is forbidden to use the API

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


404

No user with given token exists

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


429

The user has sent too many requests

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


500

An unexpected error has occurred while processing the request

Returns CspErrorResponse of type(s) application/json
"CspErrorResponse Object"
string
cspErrorCode
Optional

cspErrorCode

string
message
Optional

message

string
errorCode
Optional

errorCode

string
requestId
Optional

requestId

integer As int32 As int32
moduleCode
Optional

moduleCode

integer As int32 As int32
statusCode
Optional

statusCode


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/csp/gateway/am/api/loggedin/user