Error with Speaker Recognition API: "Resource or path can't be found."
<p>I'm trying to run the enroll profile code of speaker recognition API using Jupyter Python.</p>

<p>Unfortunately, I am getting an error:</p>

<pre><code>{ "error": { "code": "NotFound", "message": "Resource or path can't be found." } }
</code></pre>

<p>Here is the code:</p>

<pre><code>#Loading .wav file   
     w = wave.open("Harshil_recording_final.wav", "rb")
     binary_data = w.readframes(w.getnframes())
#User Enrollment
    headers = {
        # Request headers
        'Content-Type': 'application/octet-stream',
        'Ocp-Apim-Subscription-Key': '*subscription-key*',
    }

    params = urllib.urlencode({
        # Request parameters
        'identificationProfileId':user1,
        'shortAudio': 'true',
    })

    body = w

    try:
        conn = httplib.HTTPSConnection('api.projectoxford.ai')
        conn.request("POST",  "/spid/v1.0/identificationProfiles/{identificationProfileId}/enroll?%s" % params, str(body), headers)
        response = conn.getresponse()
        data = response.read()
        print(data)
        conn.close()
    except Exception as e:
        print("[Errno {0}] {1}".format(e.errno, e.strerror))
</code></pre>

<p>identificationProfileId is part of the URL path, not a query parameter.  You should do the following instead:</p>

<pre><code>params = urllib.urlencode({
        # Request parameters
        'shortAudio': 'true',
    })
...
conn.request("POST", "/spid/v1.0/identificationProfiles/{0}/enroll?{1}".format(user1, params), body, headers)
</code></pre>

python python-2.7 microsoft-cognitive