问题
We've built a SMAPI implementation that is serving up audiobooks. We're able to browse books and play them, but we're running into problems getting reporting to work correctly. We saw that the reporting endpoints for SMAPI have been deprecated, so we're attempting to follow the directions from the "Add reporting" page.
We added a reporting path at https://<our_service>/v1/reporting
and added endpoints for requests to /context
and /timePlayed
off of that base path. We're able to hit them directly ourselves, so they're running.
We also created and hosted a manifest file at https://<our_service>/v1/files/manifest.json
, which we're also able to hit directly and get the JSON file.
{
"schemaVersion": "1.0",
"endpoints": [
{
"type": "reporting",
"uri": "https://<our_service>/v1/reporting"
}
],
"strings": {
"uri": "https://<our_service>/v1/files/strings.xml",
"version": 1
}
}
After that we added our service for testing using the customsd page. We're still able to navigate the menus and play audiobooks, but Sonos appears to be sending the deprecated reporting requests to our SOAP service instead of the new reporting endpoints.
We found this question where someone appeared to be using a SMAPI implementation along with the new endpoints, but we haven't been able to figure out what we're doing differently that's causing the problem. Any ideas or suggestions would be much appreciated.
回答1:
It looks like you have unsupported version numbers for the reporting endpoint and the Manifest Uri. v1
is not supported. Acceptable version numbers are v1.0
, v2.0
or later. For reference, see:
- The example under Add a manifest file with an endpoint in Add reporting.
- POST /timePlayed for a list of features for each version.
- Cloud queue base URL and API version in Play audio (cloud queue) for details about the URL and API version format.
Updated with more details:
- The endpoint doesn’t have to have report at the end, it can be called anything.
- The order doesn’t matter. Both
/v2.1/reporting
and/stuff/report/v2.3
are valid. - The reporting endpoint doesn’t have to be HTTPS, it can be insecure HTTP.
- The manifest URL cannot be insecure, it must use HTTPS.
来源:https://stackoverflow.com/questions/57596739/sonos-music-api-service-reporting-and-manifest-file