PUT Request to Unarchive Dashboards

Hello!

I'm trying to unarchive some dashboards, but I'm having trouble making put request. Could you help me?

headers = {
    'Content-Type': 'application/json',
    'X-Metabase-Session': METABASE_SESSION,
}

params = {
    'parameters' : [{
        'type':'bool',
        'archived':True
    }]
}

response = requests.put('https://metabase.collact.com.br:4000/api/dashboard/664', headers=headers, params=params)
json.loads(response.content.decode())

Running this code generates this answer:

Hi @wallacepo
The payload should be {'archived':false}
Example with cURL it would be --data-raw '{"archived":false}'
You are mixing different endpoint structures.
The best way to learn the API, is to just use Metabase while having your browser developer Network-tab open and looking at the request, and what data is being send/received.

Thanks, flamber!

I tried this way and it worked.

headers = {
    'Content-Type': 'application/json',
    'X-Metabase-Session': METABASE_SESSION,
}

response = requests.put('https://metabase.collact.com.br:4000/api/dashboard/1236', headers=headers, json={'archived':False})
json.loads(response.content.decode())