How to create a new playlist using API

I am able to get all playlist assets, but when creating or renaming a playlist,

I get the error response,

{“error”:“Name missing or empty”},

though I am using the request as mentioned in the API documentation, info-beamer.com hosted API - info-beamer, and have given all the permissions.

I am using the code

headers = {
“Authorization”: “Bearer xxx3b6f68fbbf83dcfc2cbde8fxxxxxx”,
“Content-Type”: “application/json”
}

response = requests.request(
method=‘POST’,
url=‘https://info-beamer.com/api/v1/playlist/create’,
json={‘name’: “my_playlist”},
headers=headers
)

Kindly help as my whole project depends on it.

Regards
Arpit

info-beamer API expects the values as application/x-www-form-urlencoded, not application/json. So you need to send the value as name=my_playlist. Or in case of python the following should work:

r = requests.post(
    'https://info-beamer.com/api/v1/playlist/create',
    headers=headers,
    data={'name': 'foo'}
)

I worked, thank you so much. :ok_hand: :+1: