List related users
  • 2 minutes to read
  • Dark
    Light
  • PDF

List related users

  • Dark
    Light
  • PDF

Article summary

This document presents how to access, via API, related users’ information registered in senhasegura, the available endpoints, the parameters needed, example requests, and responses on success or in case of errors.

Authorization

To get started, make sure Users is listed under Authorized resources in your A2A module. For more information on authorization, access the How to create an authorization for an application document.

Authentication

Each request in the API must have the OAuth Consumer Key and the OAuth Token of the client.
For more information on authentication, access the How to authenticate an application document.

Methods

List all related users

Request

To access a list of related users registered in senhasegura, send a request to the following endpoint:

GET /iso/user/related

Return

Returns a list of related users registered in senhasegura and a message with information about the retrieval process.

Response parameters

FieldTypeDescriptionExample
relatedUsersArray of related usersList with all the related users and their information.
idIntRelated user’s unique identification code associated with each entry in the Related user table. This value is automatically assigned by senhasegura when creating a related user.1
nameStringThe name assigned to the related user.ademirdiniz
usernameStringUser identification name registered in senhasegura.adiniz

Expected response

HTTP/1.1 200 OK
{
    "code": 200,
    "response": {
        "status": 200,
        "message": "5 related users found",
        "error": false,
        "error_code": 0,
        "detail": "",
        "mensagem": "5 related users found",
        "erro": false,
        "cod_erro": 0
    },
    "relatedUsers": [
        {
            "id": "1",
            "name": "ademirdiniz",
            "username": "adiniz"
        },
        {
            "id": "2",
            "name": "ajoeldiniz",
            "username": "adiniz"
        },
        {
            "id": "3",
            "name": "ademir",
            "username": "adiniz"
        },
        {
            "id": "4",
            "name": "ajdiniz",
            "username": "adiniz"
        },
        {
            "id": "5",
            "name": "dedas",
            "username": "dalmeida"
        }
    ]
}

List a related user

Request

To access information about a related user registered in senhasegura, send a request to the following endpoint:

GET /iso/user/related/[id]
FieldTypeRequiredDescriptionExample
idIntYesRelated user’s unique identification code associated with each entry in the Related User table. This value is automatically assigned by senhasegura when creating a related user.3

Return

Returns a related user registered in senhasegura based on its id and a message with information about the retrieval process.

Expected response

HTTP/1.1 200 OK
{
    "code": 200,
    "response": {
        "status": 200,
        "message": "",
        "error": false,
        "error_code": 0,
        "detail": "",
        "mensagem": "",
        "erro": false,
        "cod_erro": 0
    },
    "relatedUsers": {
        "id": "3",
        "name": "ademir",
        "username": "adiniz"
    }
}

In case of error - user not found

HTTP/1.1 400 Bad Request
{
    "code": 400,
    "response": {
        "status": 400,
        "message": "1005: User does not exist",
        "error": true,
        "error_code": 1,
        "detail": "",
        "mensagem": "1005: User does not exist",
        "erro": true,
        "cod_erro": 1
    },
    "exception": {
        "code": 1005,
        "message": "1005: User does not exist",
        "detail": null
    }
}

Was this article helpful?