Search code examples
azureazure-cognitive-servicesazure-ai

Azure Cognitive Services: Custom text classification answering 404 on retrieve request


So I made Custom Multi label model on Azure and I deployed. Right now I've been trying to follow the instructions of to do the requests. The cURL to submit works well with 202 but the one to retrieve it returns: {"error":{"code":"404","message": "Resource not found"}}. This is the requests without some private info: Submit:

curl -X POST "<endpoint>/language/analyze-text/jobs?api-version=<version>" -H "Ocp-Apim-Subscription-Key: key" -H "Content-Type: application/json" -d "{\"tasks\":[{\"kind\":\"CustomMultiLabelClassification\",\"parameters\":{\"projectName\":\"prjName\",\"deploymentName\":\"model\"}}],\"displayName\":\"CustomTextPortal_CustomMultiLabelClassification\",\"analysisInput\":{\"documents\":[{\"id\":\"document_CustomMultiLabelClassification\",\"text\":\"Hello world!\",\"language\":\"en\"}]}}"

Retrieve:

curl <endpoint>/language/analyze-text/jobs?api-version=<version> -H "Ocp-Apim-Subscription-Key: key" 

Is it just bugged or is just not working anymore or Am I doing something wrong?


Solution

  • It is missing the -X GET method and the job ID in the URL. The correct format should be:

    curl -X GET "<endpoint>/language/analyze-text/jobs/{jobId}?api-version=<version>" -H "Ocp-Apim-Subscription-Key: key"