- 4 minutes to read
- Print
- DarkLight
- PDF
GET | List a credential
- 4 minutes to read
- Print
- DarkLight
- PDF
Access information of a credential registered in PAM Core.
Requirements
- Authorization with access permission to PAM Core granted by the administator in A2A.
Access the document on How to create an authorization for an application for more information. - Credential created in PAM Core.
Access the document POST | Create credential for more information.
List credential by id
- Request
GET
api/pam/credential/[id]
Request parameters
Send the parameter below in the path of the URL.
Note: this value is automatically assigned by senhasegura in POST | Create credential and is obtained in the response to the GET | List all credentials request.id
- int - required - Unique identification code of the credential.
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.
Note: these values are provided by the user in POST | Create credential and are obtained in the response to the GET | List all credentials request.username@hostname
- int - required -username
andhostname
associated with the credential separated by an @ symbol.Example:
[email protected]
Example request
GET
{{url}}api/pam/[email protected]
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. 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.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.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.