Discussions

Ask a Question
Back to All

Getting internal server error on both talks and audios endpoints

Code I am using for audios endpoint ("https://api.d-id.com/audios") :

def upload_audio(file_path):  
    # Prepare the payload for the API request  
    payload = {  
        "audio": file_path,  
    }  
    headers = {  
        "Authorization": f"Basic {API_TOKEN}",  
        "Content-Type" : "multipart/form-data",  
        "Accept" : "application/json",  
    }
    try:
        # breakpoint()
        # Make the API request to D-ID's API
        response = requests.post(upload_audio_endpoint, json=payload, headers=headers)

        if response.status_code == 200:
            response_json = response.json()
            result_url = response_json.get("result_url", None)

            return result_url

Getting the same 500 error on talks endpoint as well (https://api.d-id.com/talk) . Not sure what is going wrong.