This is a free API to help you retrieve the Nid (assetCid) from AssetTree file. It requires either a fileURL or input nid or a file object along with a valid Capture Tokenfor authorization. If you do not already have a Capture Token yet, please follow the instructions provided to create one.
API Endpoint: https://eoulu4xwyfomadg.m.pipedream.netCost:0NUM (free to use)Method:POSTDescription:This is a free API to help you retrieve the Nid of any file.Authentication:This API requires a valid token for Authorization. The token should be passed in the headers of the request using the following format: "Authorization: token YOUR_CAPTURE_TOKEN"
Header:Authorization: token $YOUR_CAPTURE_TOKEN (required)Content-Type: application/jsonRequest Body (required):fileURL (string) // URL of your AssetTree file or file (object) // uploading AssetTree file directly ornid (string) // input Nid of your AssetTree fileOne of the three above must be providedExample 1 (direct file upload):curl -F"file=@/tmp/my_asset_tree.json" \-H"Authorization: token YOUR_CAPTURE_TOKEN" \"https://eoulu4xwyfomadg.m.pipedream.net"Example 2 (upload via URL)curl -XPOST"https://eoulu4xwyfomadg.m.pipedream.net" \-H"Content-Type: application/json" \-H"Authorization: token YOUR_CAPTURE_TOKEN" \-d '{"fileURL": AssetTree_URL }'Response:{"nid": string // assetCid found in the AssetTree}200: Cid/Nid retrieved successfully400: Bad request401: Unauthorized403: Forbidden500: Internal Server Error
In this example, you would replace YOUR_CAPTURE_TOKEN with your actual Capture token and /tmp/my_asset_tree.json or AssetTree_URL with the actual file on your filesystem. More examples can be found below: