Aliases

Request Aliases

Performing a GET command returns the associated alias objects.

Table 1. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases The GET method submits the accountId and returns the associated id, longName, expereOrganization and aliasName for each alias.
Table 2. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases

Replace {accountId} with the value of the actual accountId.

Example /DGSCoreManagement/api/rest/library/accounts/1/aliases
Table 3. Responses
Code Description
200 Successful response
Example:
{
    "id": "6e5bbef5-1db1-40ff-a946-9eb6c71a0277",
    "longName": "Cheryl",
    "expereOrganization": null,
    "aliasName": "Cheryl"
},
{
    "id": "419c15ac-9059-44aa-89da-7e6fbfb4ced5",
    "longName": "John",
    "expereOrganization": null,
    "aliasName": "John"
}

Note: expereOrganization returns null only if the alias is not associated with an Organization.

401 Not Authorized
404 Aliases not found
500 Unexpected error

Request Specific Alias

Performing a GET command returns the associated specified alias object.

Table 4. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId} The GET method submits the accountId and aliasId and returns the associated id, longName, expereOrganization and aliasName.
Table 5. Parameters
Name Type Constraints Description
body string required

accountId: an integer value indicating the account to query

aliasId: a string value for the alias

Examples Request an alias by aliasName:

/DGSCoreManagement/api/rest/library/accounts/1/aliases?AliasName=JohnCarter

Request an alias by aliasID:

/DGSCoreManagement/api/rest/library/accounts/1/aliases/419c15ac-9059-44aa-89da-7e6fbfb4ced5

Note: Requesting a specific alias by longName is not supported.
Table 6. Responses
Code Description
200 Successful response
{
    "id": "419c15ac-9059-44aa-89da-7e6fbfb4ced5",
    "longName": "JohnCarter",
    "expereOrganization": null,
    "aliasName": "John"
}
Note: expereOrganization returns null only if the alias is not associated with an Organization.
401 Not Authorized
404 Aliases not found
500 Unexpected error

Create an Alias

Performing a POST command creates a new alias object.
Note:
  • All alias names must be unique. An error response is returned if you attempt to create or rename an alias if an identical alias name already exists.
  • Neither the longName nor aliasName can contain regular expressions. Strings containing regular expressions return an error.
Table 7. Method
Method URL Description
POST /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases The POST method submits the longName and aliasName and returns a new associated id, longName, expereOrganization and aliasName.
Table 8. Parameters
Name Type Constraints Description
body string required

longName: a string value assigned to the alias

aliasName: a string value used an alias for the longName

Example
url:
/DGSCoreManagement/api/rest/library/accounts/1/aliases
body:
{
  "longName": "JohnCarter",
  "aliasName": "JohnC"
}
Table 9. Responses
Code Description
201 Successful response
{
    "id": "6e5bbef5-1db1-40ff-a946-9eb6c71a0277",
    "longName": "JohnCarter",
    "expereOrganization": null,
    "aliasName": "JohnC"
}

Note: expereOrganization returns null only if the alias is not associated with an Organization.

401 Not Authorized
500 Unexpected error

Update an Existing Alias

Performing a PATCH command updates a specified existing alias object.
Note:
  • All alias names must be unique. An error response is returned if you attempt to create or rename an alias if an identical alias name already exists.
  • Neither the longName nor aliasName can contain regular expressions. Strings containing regular expressions return an error.
Table 10. Method
Method URL Description
PATCH /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId} The PATCH method submits the longName and/or aliasName and returns the associated id, longName, expereOrganization and aliasName.
Table 11. Parameters
Name Type Constraints Description
body string required The body of the request must contain the longName, the aliasName or both.
Note: The longName must begin with "expere"
Example
{
  "longName": "expere-JohnCarter",
  "aliasName": "JohnC"
}
Table 12. Responses
Code Description
200 Successful response
{
  "id": "419c15ac-9059-44aa-89da-7e6fbfb4ced5",
  "longName": "expere-JohnCarter",
  "expereOrganization": null,
  "aliasName": "JohnC"
}
Note: expereOrganization returns null only if the alias is not associated with an Organization.
400 Bad Request
401 Not Authorized
404 Aliases not found
500 Unexpected error

Deleting an Existing Alias

The DELETE method removes an alias from the specified accountId.

Table 13. Method
Method URL Description
DELETE /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId} The DELETE method submits the aliasId and removes it from the specified accountId.
Table 14. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}
Example /DGSCoreManagement/api/rest/library/accounts/1/aliases/6e5bbef5-1db1-40ff-a946-9eb6c71a0277
Table 15. Responses
Code Description
202 Successful response
401 Not Authorized
404 Alias not found
500 Unexpected error

Request Allowed Accounts for an Alias

This method uses a GET command to retrieve the allowed accounts for a specified alias.

Table 16. Method
Method URL Description
GET /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts The GET method submits the accountId and aliasId and returns the associated allowed accounts for the alias.
Table 17. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts

Replace {accountId} with the value of the actual accountId and {aliasId} with the actual aliasId.

Example /DGSCoreManagement/api/rest/library/accounts/1/aliases/419c15ac-9059-44aa-89da-7e6fbfb4ced5/allowedAccounts
Table 18. Responses
Code Description
200 Successful response
Example:
[
    1, 2, 3
]
401 Not Authorized
404 Libraries not found
500 Unexpected error

Add Allowed Accounts for an Alias

This method uses a POST command to add an allowed account for a specified alias.

Table 19. Method
Method URL Description
POST /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts The POST method submits the allowedAccounts with the array in the body and returns the associated allowed accounts for the alias.
Table 20. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts

Replace {accountId} with the value of the actual accountId and {aliasId} with the actual aliasId.

Example

url:

/DGSCoreManagement/api/rest/library/accounts/1/aliases/419c15ac-9059-44aa-89da-7e6fbfb4ced5/allowedAccounts

body:

[
  2, 3
]
Table 21. Responses
Code Description
200 Successful response
Example:
[
    1,
    2,
    3
]
401 Not Authorized
404 Libraries not found
500 Unexpected error

Remove Allowed Accounts for an Alias

This method uses a DELETE command to remove an allowed account for a specified alias.

Table 22. Method
Method URL Description
DELETE /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts The DELETE method removes the allowedAccounts specified using an array in the body and returns the updated associated allowed accounts for the alias.
Table 23. Parameters
Name Type Constraints Description
url string required /DGSCoreManagement/api/rest/library/accounts/{accountId}/aliases/{aliasId}/allowedAccounts

Replace {accountId} with the value of the actual accountId and {aliasId} with the actual aliasId.

Example

url:

/DGSCoreManagement/api/rest/library/accounts/1/aliases/419c15ac-9059-44aa-89da-7e6fbfb4ced5/allowedAccounts

body:

[
    3, 4
]
Table 24. Responses
Code Description
202 Successful response
Example:
[
    1,
    2
]
401 Not Authorized
404 Libraries not found
500 Unexpected error