Closed adri1m64 closed 5 months ago
Can you share the script you created?
hey, sure:
import json
import requests
fichier = open(r"C:/Users/adrie/Downloads/orphans.json" ,"r")
dico = json.loads(fichier.read()) #Ouverture du fichier
fichier.close()
print("ouverture du fichier")
res = []
for i in dico:
res.append(i["entityId"]) #On crée une liste des entity id
print("liste crée")
final = []
for i in res:
if i not in final:
final.append(i)
print("tri effectué")
url = "https://myip.com/api/asset"
for i in final:
payload = json.dumps({
"force": True,
"ids": [
str(i)
]
})
headers = {
'Content-Type': 'application/json',
'x-api-key': 'apikey'
}
response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
Sorry it's in French but the comments are
The ip and api key are correct in my script because the GET request are working, i just change to not publish it.
Thank you!
The bug
Hello, i've an issue with the API. I can't use the DELETE request put the GET is working. I wanted to delete my orphans assets so first I tried the recommended script but it return:
An error occurred: 400 Client Error: Bad Request for url: https://MYIP.COM/api/asset
(I've changed with my ip it's just for example). So I tried to create my own script but at the moment of the request, it return me{"message":"Not found or no asset.delete access","error":"Bad Request","statusCode":400}
.Thank you
The OS that Immich Server is running on
Docker on Windows
Version of Immich Server
v1.99.0
Version of Immich Mobile App
1.99.0 build.129
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
No response