在我的上一个问题Azure Media Services Encoding Job Callback to URL中,建议在编码作业完成时,Azure媒体服务“支持WebHooks的通知功能”可用于回调URL。我有一些麻烦让这个工作。Azure媒体服务如何设置作业通知
采取的步骤:
- 创建和测试一个天青功能,其能够发送POST请求我的任意回调URL的。
- 使用REST API创建NotificationEndPoint并检索Id(类似于
nb:nepid:UUID:e9203dcb-b6a0-4b44-3cc6-69c4a573bb8d
)。 - 现在试图将通知添加到我的编码作业中。我对工作的JSON有效载荷创建REST API调用如下:
{
"Name": "TestJob",
"InputMediaAssets" : [
{
"__metadata" : {"uri" : "https://media.windows.net/api/AssetsAssets('nb%3Acid%3AUUID%3A3679cd1f-74ba-4374-8d4b-8c26feba4e1d')"}
}
],
"JobNotificationSubscriptions": [
{
"NotificationEndPointId": "nb:nepid:UUID:e9203dcb-b6a0-4b44-3cc6-69c4a573bb8d",
"TargetJobState": 1
}
],
"Tasks": [
{
"Configuration": "Adaptive Streaming",
"MediaProcessorId": "nb:mpid:UUID:fa4df505-d219-42b0-bc17-a481c1441e56",
"TaskBody": "<?xml version=\"1.0\" encoding=\"utf-8\"?><taskBody><inputAsset>JobInputAsset(0)</inputAsset><outputAsset>JobOutputAsset(0)</outputAsset></taskBody>"
}
]
}
这一工程没有的JobNotificationSubscriptions
部分,但有了它,我只是得到了响应:
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "An error occurred while processing this request."
}
}
如何才能让我的通知与我的工作一起工作?