Authentication (Sessions)
Gets current session (checks if user is logged in).
Specify additional objects to include in the session response. Supports 'csrfToken' and 'user'. Multiple inclusions may be specified using additional 'include' query parameters or by comma-separated list.
The user is logged in.
The user is not authenticated.
GET /rest/2.0/auth/sessions/current HTTP/1.1
Authorization: Basic username:password
Accept: */*
{
"csrfToken": "text",
"user": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"userName": "text",
"firstName": "text",
"lastName": "text",
"title": "text",
"department": "text",
"emailAddress": "text",
"gender": "MALE",
"language": "text",
"additionalEmailAddresses": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"emailAddress": "text"
}
],
"phoneNumbers": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"type": "FAX",
"phoneNumber": "text"
}
],
"instantMessagingAccounts": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"account": "text",
"type": "AOL"
}
],
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"url": "text",
"type": "FACEBOOK"
}
],
"addresses": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"city": "text",
"street": "text",
"number": "text",
"state": "text",
"country": "text",
"postalCode": "text",
"type": "HOME"
}
],
"activated": true,
"enabled": true,
"userSource": "INTERNAL",
"userSourceString": "text",
"guestUser": true
}
}Logs current user out and destroys the active session.
The user was logged out and session closed.
No content
The user is not authenticated.
DELETE /rest/2.0/auth/sessions/current HTTP/1.1
Authorization: Basic username:password
Accept: */*
No content
Returns 200 if user session is active and 401 if the session is expired or doesn't exist
The user is authenticated
No content
The user is not authenticated.
GET /rest/2.0/auth/sessions/heartbeat HTTP/1.1
Authorization: Basic username:password
Accept: */*
No content
Authenticates a user and creates a new session on the server. Once the user is authenticated then the returned session id can be used to access DGC REST Api in subsequent requests. The method additionally returns the JSESSIONID cookie in a Set-Cookie header. If user already has an open session then this session will be terminated.
The user was logged in and a new session was created. The response includes the CSRF token that is created
The user is not authenticated.
POST /rest/2.0/auth/sessions HTTP/1.1
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"username": "text",
"password": "text"
}{
"csrfToken": "text",
"user": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"userName": "text",
"firstName": "text",
"lastName": "text",
"title": "text",
"department": "text",
"emailAddress": "text",
"gender": "MALE",
"language": "text",
"additionalEmailAddresses": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"emailAddress": "text"
}
],
"phoneNumbers": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"type": "FAX",
"phoneNumber": "text"
}
],
"instantMessagingAccounts": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"account": "text",
"type": "AOL"
}
],
"websites": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"url": "text",
"type": "FACEBOOK"
}
],
"addresses": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"createdBy": "4d250cc5-e583-4640-9874-b93d82c7a6cb",
"createdOn": 1475503010320,
"lastModifiedBy": "a073ff90-e7bc-4b35-ba90-c4d475f642fe",
"lastModifiedOn": 1476703764163,
"system": true,
"city": "text",
"street": "text",
"number": "text",
"state": "text",
"country": "text",
"postalCode": "text",
"type": "HOME"
}
],
"activated": true,
"enabled": true,
"userSource": "INTERNAL",
"userSourceString": "text",
"guestUser": true
}
}Last updated
Was this helpful?