Image Asset Add by API


I am able to add web URL asset using API, but no luck for JPG images files, I am using the following command … not sure where I am missing … i am getting Invalid URL. Failed to add asset.

pi@pi:~/screenly $ curl -s -X POST “
-H “accept: image/jpeg”
-H “content-type: application/json”
-d “{ "mimetype": "image",
"is_enabled": 1,
"name": "my_first_file",
"end_date": "9999-01-01T00:00:00.000Z",
"duration": "10",
"uri": "file//home/pi/jpg.jpg",
"skip_asset_check": 1,
"start_date": "2023-10-17T10:37:28.486Z"}”
{“error”: “Invalid URL. Failed to add asset.”}pi@pi:~/screenly $

Request your help to correct my add asset syntex


Yeah that doesn’t look right to me. You’re using " inside ". See this post for details.

But in short, you probably want to do something like this:

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"mimetype": "image", "is_enabled": 1 [...]}' \
1 Like

Thanks @vpetersson for your support !! I have passed the local file via web URL like