EN
Español
English
Português
    Add Relationships

    Petition Details

    • Base URL: {host}/ASMSAPI/
    • Uri: /api/v9/ci/{id}/relation
    • 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/ci/{id}/relation
    


    Parameters:

    Name Data type Obligatory Description
    Id Number Yes Identifier of the CI.
    itemType Text Yes Type of item.
    relatedItemType Text Yes Type of item to be related (Incidents, Problem, Change, Release, ServiceCall, Task, Maintenance, Ci, Packages, Contract, Invoice, OtherDocument, Article.)
    relatedItemId Number Yes Identifier of the item to be related.
    relationTypeId Number Yes Identifier of the type of relationship.
    typeIsReverse Bool Yes Identifier to determine if the main IC with whom the relationship is established is a parent or a child.

    Body of the petition

    Ejemplo de relación de **CI** con **CI**. {
    
        "id": 147,
        "itemType": "ci",
        "relatedItemId": 1035,
        "relatedItemType": "ci",
        "relationTypeId": 139,
        "typeIsReverse": true
    
    
    }
    
    Ejemplo de cuerpo de la relación de ***CI*** con ***Article***: {
    
        "id": 147,
        "itemType": "ci",
        "relatedItemId": 58,
        "relatedItemType": "article",
        "relationTypeId": 137,
        "typeIsReverse": true
    
    }
    
    *Respuesta*
    
    {
        "result": true 
    }
    

    Response Parameters

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

    Error messages

    Code HTTP status Error Message
    400 BadRequest \r\nParameter Name: Id
    400 BadRequest InvalidItemType
    400 BadRequest InvalidRelatedItemId
    400 BadRequest InvalidRelatedItemType
    400 BadRequest InvalidRelationTypeId
    400 BadRequest InvalidProjectId
    400 BadRequest RequestNeedsSomeArguments
    403 Forbidden DoNotHavePermissionForThisAction
    500 InternalServerError FailureAddRelatedItem