EN
Español
English
Português
    User Management

    This section describes the operations related to user management (creating, editing, listing users).

    List of users by project

    List the users of a given project that match the search criteria

    Petition Details

    • URI: api/v8.6/user/list
    • Type: POST
    • Required headings:

    • content-type: application/json
    • Authorization: TOKEN

    Parameters

    Name Data type Obligatory Description
    ProjectId Number Yes Project ID. This field is required, since the users who belong to a certain project are listed.
    ComparisonOperatorId Number Yes
    Comparator operator ID. The values are:
    1. >
    2. <
    3. >=
    4. <=
    5. =
    6. <>
    7. EXIST (IS NOT NULL)
    8. NOT EXIST (IS NULL)
    9. > GETDATE()
    10. < GETDATE()
    11. TRUE (1)
    12. FALSE (0)
    13. LIKE
    FieldName Text Yes Field by which the search is to be carried out
    LogicOperatorId Number Yes Id of the logical operator. The possible values are: 1 (AND) and 2 (OR).
    Value Text Yes Text to be searched


    Note: The data type of the FieldName parameter must be considered in order to use the appropriate operator. Text-type fields use: 5, 6, 13.


    Body of the petition

    Example with a single condition:

    {
        "ProjectId": 2,
        "Criteria": [
            {
                "ComparisonOperatorId": 13,
                "FieldName": "UserName",
                "LogicOperatorId": 1,
                "Value": "mbarrios"
            }
        ]
    }
    

    Example with more than one condition:

    This example performs the user search with Document = ‘1234567890’ OR UserName LIKE ‘%Usr2%’ AND Name LIKE ‘%User 1%’

    {
        "ProjectId": 1,
        "Criteria": [
            {
                "ComparisonOperatorId": 5,
                "FieldName": "Document",
                "LogicOperatorId": 2,
                "Value": "1234567890"
            },
            {
                "ComparisonOperatorId": 13,
                "FieldName": "UserName",
                "LogicOperatorId": 1,
                "Value": "Usr1"
            },
            {
                "ComparisonOperatorId": 13,
                "FieldName": "Name",
                "LogicOperatorId": 2,
                "Value": "Usuario 1"
            }
        ]
    }
    

    Answer

    The service will return a Json with the following information:

    Example:

    {
        "Data": [
            {
                "Address": null,
                "CompanyId": null,
                "CompanyName": null,
                "Document": null,
                "Email": "test@arandasoft.com",
                "Id": 471,
                "Mobile": null,
                "Name": "Mayra Barrios",
                "Phone": null,
                "Picture": null,
                "ProfileId": 0,
                "UserActive": false,
                "UserName": "mbarrios"
            },
            {
                "Address": null,
                "CompanyId": null,
                "CompanyName": null,
                "Document": null,
                "Email": "mayra.barrios@arandasoft.com",
                "Id": 3913,
                "Mobile": null,
                "Name": "Mayra Barrios 1",
                "Phone": null,
                "Picture": null,
                "ProfileId": 0,
                "UserActive": false,
                "UserName": "mbarrios1"
            },…
        ],
        "Paging": {
            "Count": 2
        }
    }
    


    Error messages

    Code HTTP status Error Message
    400 Badrequest InvalidProjectId
    400 BadRequest InvalidOperatorId
    400 BadRequest InvalidLogicOperatorId
    400 BadRequest InvalidValue
    500 InternalServerError FailureGetUsers