Hello,
I am attempting to create a custom text classification project using Azure AI Language resource REST API, but I am encountering a "request failed with status code: 415" error. I followed the steps outlined in this Microsoft Learn article: https://video2.skills-academy.com/en-us/azure/ai-services/language-service/custom-text-classification/how-to/create-project?tabs=azure-portal%2Capis%2Cmulti-classification. I have already assigned the 'Storage Blob Data Owner' role to the language resource in storage account.
Here's the code that I am having trouble with:
import requests
url = "<language resource endpoint>/language/authoring/analyze-text/projects/myProject?api-version=2022-05-01"
headers = {
"Ocp-Apim-Subscription-Key": "<language resource key>",
"Content-Type":"application/json"
}
body = {
"projectName": "myProject",
"language": "en-us",
"projectKind": "customMultiLabelClassification",
"description": "Project description",
"multilingual": "True",
"storageInputContainerName":"<Container Name>"
}
response = requests.patch(url=url, headers=headers, json=body)
I am getting an error "request failed with status code: 415" as output.
Would someone be able to provide some guidance on how to fix this error? Thank you.