EN
Español
English
Português
    Edit values in additional fields such as list, tree, and multi-select

    Petition Details

    • URL Base: {host}/ASMSAPI/
    • URI: /api/v9/additionalsfields/values/{fieldValueId}
    • Guy:PUT
    • Required Headers:

    • 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.
    • {fieldValueId}: ID of the value of the additional field (list, tree, or multi-select) that you want to edit.
    • URI: Specific endpoint for the request.


    ⚐ EXAMPLE URL:

    https://{host}/ASMSAPI/api/v9/additionalsfields/values/2950
    


    Previous Step: Get the Id of the Value to Edit

    Before editing a value, refer to the list of values in the field to identify the id of the value to be changed:

    Query endpoint:

    GET /ASMSAPI/api/v9/additionalsfields/{fieldId}/type/7/values?dataType=0
    

    Query parameters:

    Name Data type Description
    fieldId Number Additional field ID (list, tree, or multi-select)
    type Number Field Type (7 for List, Tree, and Multi-Select)
    Datatype Number Data Type (0 default)

    Sample answer:

    [
        {
            "catalogId": 0,
            "description": null,
            "fieldId": 1787,
            "hasChild": false,
            "id": 2950,
            "key": null,
            "name": "API",
            "order": 0,
            "parentId": null,
            "restrictLevel": false,
            "status": 0
        }
    ]
    

    ⚐ Note: >

    • The countryside id in the answer is the one that should be used as {fieldValueId} in the edit URL.


    Petition Parameters

    Name Data type Obligatory Description
    Value Text Yes New text/name that will replace the current value

    Body of the petition

    {
      "Value": "Bogotá"
    }
    

    ⚐ Note: >

    • The edit only updates the text/name of the value (Value). The ParentId, the RestrictLevel and the Status of the value are not modified by this endpoint.
    • You are not allowed to update a value with a name that already exists in that same field.


    Answer

    Success (Status 200)

    {
        "result": true
    }
    

    Response Parameters

    Name Data type Description
    result Boolean Indicates whether the operation was successful


    Error Messages

    Code HTTP status Error Message
    401 Unauthorized You do not have permission to view this directory or page
    400 Bad Request FailureUpdateFieldValue
    400 Bad Request InvalidAdditionalFieldValue (the fieldValueId does not exist)