EN
Español
English
Português
    Removing Values in Additional Fields such as List, Tree, and Multiple Select

    Petition Details

    • URL Base: {host}/ASMSAPI/
    • URI: /api/v9/additionalsfields/values/{fieldValueId}
    • Guy: DELETE
    • 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 Multiple Select) that you want to delete.
    • 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 Delete

    Before deleting a value, refer to the list of values in the field to identify the id of the value you want to delete:

    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 Multiple 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": 2940,
            "restrictLevel": true,
            "status": 0
        }
    ]
    

    ⚐ Note: >

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


    Petition Parameters

    This request does not receive parameters or body; all the necessary information travels in the {fieldValueId} of the URL.

    ⚐ Note: >

    • Deleting a tree-type value that has child values associated with it is not allowed; the children must be deleted first.
    • When you delete a child value that was the only one in its tier, the parent value automatically reverts to the restrictLevel: true, being again marked as the last available level.


    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 FailureDeleteFieldValue
    400 Bad Request InvalidAdditionalFieldValue (the fieldValueId does not exist)
    400 Bad Request FieldValueHasChildren (value has child values and cannot be deleted)