12. TrakIT API‎ > ‎Asset‎ > ‎

Link/Unlink Assets

The below API is used to link an asset to another asset.

Request: POST

Signature: /api/mobile/LinkAsset

Body: 

"Token":"Token",
"AssetID":AssetID_To_Link,
"LinkTo":AssetID_To_Link_To,
"Replace":Replace_or_not


Sample: /api/mobile/LinkAsset
Body: 

"Token":"VomYEMiECFFyAQ3==",
"AssetID":123,
"LinkTo":234, 
"Replace": true

Response:

{
"Code": 1,
"Info": "Asset linked successfully",
"RowsAffected": 1,
"Scalar": null,
"Identity": 0,
"RetInfo": null
}


Things to know about this API: 
  1. Token - You can use Login API to get token displayed under Info

  2. These fields are mandatory while sending request body: 

    • AssetID - The ID of the asset being linked
    • LinkTo - The ID of the asset to which the first asset is linked
    • Replace - Whether to replace any existing linked assets of the same type


The below API is used to unlink an asset that is linked to another.


Request: POST 

Signature: /api/mobile/UnlinkAsset

Body: 

"Token":"Token",
"AssetID":AssetID_To_Link


Sample: /api/mobile/UnlinkAsset
Body: 

"Token":"VomYEMiECFFyAQ3==",
"AssetID":123

Response:


"Code": 1,
"Info": "Asset unlinked successfully",
"RowsAffected": 1,
"Scalar": null,
"Identity": 0,
"RetInfo": null
}


Things to know about this API: 
  1. Token - You can use Login API to get token displayed under Info

  2. These fields are mandatory while sending request body: 

    • AssetID - The ID of the asset being unlinked
Comments