EN
Español
English
Português
    Partnership of companies to customers

    Petition Details

    • Base URL: {host}/ASMSAPI/
    • Uri: api/v9/user/{user_id}/companies
    • Type: POST
    • Required headings:

    • content-type: application/json
    • X-Authorization: Bearer {token}

    URL Description

    • {host}: It represents the domain of the environment in which the API is located.
    • ASMSAPI/: Fixed API prefix.
    • URI: Specific endpoint for the request.


    EXAMPLE URL:

    https://{host}/ASMSAPI/api/v9/user/{user_id}/companies
    


    Parameters

    Name Data type Obligatory Description
    user_id Number Yes Unique customer identifier.
    companiesId Array[int] Yes List of IDs of the companies that will be associated with the client (maximum 100 companies). If more than 100 companies are submitted, only the first 100 IDs in the array will be considered.

    Body of the petition

    {
        "companiesId": [
            1,
            3,
            4,
            5
        ]
    }
    
    **Respuesta**
    
    200 OK
    
    

    Error messages

    Code HTTP status Error Message
    409 Conflict It occurs when any of the submitted IDs do not exist in the database. However, companies that do exist will be properly associated.
    404 Not Found “message”: “CompanyIdInvalid” (the company ID does not exist or is associated only as a provider).
    400 BadRequest “exceptionMessage”: “NoCompaniesProvided”.