GET | List a credential
  • 4 minutes to read
  • Dark
    Light
  • PDF

GET | List a credential

  • Dark
    Light
  • PDF

Article summary

Access information of a credential registered in PAM Core.

Requirements

List credential by id - Request

GET api/pam/credential/[id]

Request parameters

Send the parameter below in the path of the URL.

Example request

GET {{url}}/api/pam/5

Response

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Credential 5",
        "erro": false,
	 "detail": "",
        "message": "Credential 5",
        "error": false,
	 "error_code": 0
    },
    "credential": {
        "id": "5",
        "identifier": "robot-test-5",
        "username": "credential_5",
        "password": "secret@2504",
        "content": "secret@2504",
        "hostname": "destktop-91.com",
        "parent_credential_cod": null,
        "parent_credential": null,
        "additional": "CREDADD01",
        "domain": "",
        "ip": "172.10.10.90",
        "port": "22",
        "model": "Ubuntu",
        "expiration_time": "2021-01-16T17:31:39"
    }

List credential by username@hostname - Request

GET api/pam/credential/[username@hostname]

Request parameters

Send the parameter below in the path of the URL.

Example request

GET {{url}}api/pam/[email protected]

Attention

If the username provided has an @ in it, as in johndoe@senhasegura, the endpoint won’t work as expected due to the conflict caused by the presence of two @ symbols.

HTTP/1.1 200 OK
{
    "response": {
        "status": 200,
        "mensagem": "Credential 5",
        "erro": false,
	 "detail": "",
        "message": "Credential 5",
        "error": false,
	 "error_code": 0
    },
    "credential": {
        "id": "5",
        "identifier": "robot-test-5",
        "username": "credential_5",
        "password": "secret@2504",
        "content": "secret@2504",
        "hostname": "destktop-91.com",
        "parent_credential_cod": null,
        "parent_credential": null,
        "additional": "CREDADD01",
        "domain": "",
        "ip": "172.10.10.90",
        "port": "22",
        "model": "Ubuntu",
        "expiration_time": "2021-01-16T17:31:39"
    }

Response body fields

  • credential - object - Credential data.
    → id - int - Unique identification code of the credential.


    →identifier - string - Unique string defined by the user or senhasegura for identifying the credential.    Note: this value can be updated through the POST api/pam/credential endpoint.


    →username - string - Username assigned to the credential.


    →expiration - string - Expiration date and time of the credential based on ISO 8601.


    →password - string - Password assigned to the credential.


    →content - string - Password assigned to the credential.


    →hostname - string - Hostname of the device associated with the credential.


    →parent_credential_cod - string - Parent credential’s identifier.


    →parent_credential - string - Parent credential.    Note: when you select a parent credential, the child credential will assume the same password as the parent credential. Whenever there is a manual or automated password change on the parent credential, the child credential will also be modified and assume the same password as the parent credential.


    →additional - string - Additional information about the credential.


    →domain - string - Domain’s name or abbreviation.


    →ip - string - IP address of the device associated with the credential.


    →port - string - Port of the device associated with the credential.


    →port - string - Port of the device associated with the credential.


    →model - string - Device model.


    →expiration_time - string - Date and time of credential expiration based on ISO 8601.    Example: 2024-05-16T17:31:31-03:00


Errors

400 - Bad Request

Message: "1007: Credential not found"

Possible cause: the credential wasn’t found.

Solution: check if the values for the parameters used to search for the credential were correct and resend the request.


Message: "1009: No access to credential"

Possible cause: you’re not authorized to access the credential.

Solution: ask the administrator to check your permission to access the credential.


Message: "1010: The item is not a credential"

Possible cause: the value for the id parameter doesn’t belong to a credential.

Solution: check the id and resend the request.


404 - Not Found

Message: "Resource sub not found"

Possible cause: the URL or the requested resource isn’t correct.

Solution: check the URL and make sure the parameter is correct.


500 - Internal Server Error

Message: "Unexpected error."

Possible cause: the error is in the senhasegura server.

Solution: contact the support team for more information.


Message: "You are not authorized to access this resource."

Possible cause: you don’t have the authorization to access this resource.

Solution: ask the administrator to check your permission to access the PAM Core resources in A2A.


Client authentication failed

Message: "Client authentication failed."

Possible cause: failure in your application authentication with the senhasegura server.

Solution: check the authentication parameters such as Access Token URL, Client ID e Client secret and request a new access token.


Invalid signature

Message: "Invalid signature"

Possible cause: failure in recognizing the URL of the client application.

Solution: check the URL of the client application and resent the request.


No route matched with those values

Message: "No route matched with those values."

Possible cause: the authorization header is missing in the API request.

Solution: request a new access token.


Request timed out

Message: "Request timed out."

Possible cause: the request time has expired.

Solution: check the connectivity between the source of the request and the senhasegura server.


Was this article helpful?