百度智能云

All Product Document

          Multimedia Cloud Processing

          Notification Interface

          The MCT service uses queue notification service (QNS) for notification, and will push messages to the developer server when the job status of the MCT is transferred.

          Create Notification

          Request

          • Request syntax:

                POST /v{version}/notification HTTP/1.1 
                accept-encoding: gzip, deflate 
                x-bce-date: {utc-date-string} 
                host: media.bj.baidubce.com 
                accept: */* 
                connection: keep-alive 
                x-bce-request-id: {bce-request-id} 
                content-type: application/json
                authorization: {bce-authorization-string} 
          • Request header: No special Header parameter
          • Request parameter (the followings are Requestbody parameters):
          Field name Field type Necessity Field description Optional value Default value
          name String Required Notification name. Starting with a lowercase letter, the rest is composed of lowercase letters, underline (_) or figures, with a maximum of 40 characters. - -
          endpoint String Required Receiving address of notification message - -
          type String Optional Type of notification message NONE represents common notification callback; SIGN represents authorization mode, and will increase Notification-Auth-Expire, Notification-Auth-User and Notification-Auth-Token in the header for verification. After you receive the callback, you can use SHA256-HEX to upload your own token and “POST; endpoint; content; expireTime; user " to generate Notification-Auth-Token for verification by comparing with the header NONE, SIGN NONE.
          token String Optional Notification message authentication token - -
          • Request example:

                POST /v3/notification HTTP/1.1 
                content-length: 87
                accept-encoding: gzip, deflate 
                x-bce-date: 2015-07-03T09:28:13Z 
                connection: keep-alive 
                accept: */* 
                user-agent: python-requests/2.4.0 CPython/2.7.9 Darwin/14.3.0 
                host: media.bj.baidubce.com 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                content-type: application/json
                authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-bce-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715 
                  
                { 
                  "name": "mct_notification", 
                  "endpoint": "http://mct.notificaitonDomain.com/" 
                } 

          Response

          • Response header: No special Header parameter
          • Response parameter: None
          • Response example:

                HTTP/1.1 200 OK 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                Date: Fri, 03 Jul 2015 09:28:13 GMT 
                Transfer-Encoding: chunked 
                Content-Type: application/json;charset=UTF-8 
                Cache-Control: no-cache

          Query Notification

          Request

          • Request syntax:

                GET /v{version}/notification/{name} HTTP/1.1 
                accept-encoding: gzip, deflate 
                x-bce-date: {utc-date-string} 
                host: media.bj.baidubce.com 
                accept: */* 
                connection: keep-alive 
                x-bce-request-id: {bce-request-id} 
                content-type: application/json
                authorization: {bce-authorization-string} 
          • Request header: No special Header parameter
          • Request parameter: None
          • Request example:

                GET /v3/notification/mct_notification HTTP/1.1 
                content-length: 0
                accept-encoding: gzip, deflate 
                x-bce-date: 2015-07-03T09:28:13Z 
                connection: keep-alive 
                accept: */* 
                user-agent: python-requests/2.4.0 CPython/2.7.9 Darwin/14.3.0 
                host: media.bj.baidubce.com 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                content-type: application/json
                authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-bce-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715 

          Response

          • Response header: No special Header parameter
          • Response parameter:
          Field name Field type Field description
          name String Notification name
          endpoint String Receiving address of notification message
          • Response example:

                HTTP/1.1 200 OK 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                Date: Fri, 03 Jul 2015 09:28:13 GMT 
                Transfer-Encoding: chunked 
                Content-Type: application/json;charset=UTF-8 
                Cache-Control: no-cache
                  
                { 
                  "name" : "mct_notification", 
                  "endpoint" : "http://mct.notificaitonDomain.com/" 
                } 

          Delete Notification

          Request

          • Request syntax:

                DELETE /v{version}/notification/{name} HTTP/1.1 
                accept-encoding: gzip, deflate 
                x-bce-date: {utc-date-string} 
                host: media.bj.baidubce.com 
                accept: */* 
                connection: keep-alive 
                x-bce-request-id: {bce-request-id} 
                content-type: application/json
                authorization: {bce-authorization-string} 
          • Request header: No special Header parameter
          • Request parameter: None
          • Request example:

                DELETE /v3/notification/mct_notification HTTP/1.1 
                content-length: 0
                accept-encoding: gzip, deflate 
                x-bce-date: 2015-07-03T09:28:13Z 
                connection: keep-alive 
                accept: */* 
                user-agent: python-requests/2.4.0 CPython/2.7.9 Darwin/14.3.0 
                host: media.bj.baidubce.com 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                content-type: application/json
                authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-bce-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715 

          Response

          • Response header: No special Header parameter
          • Response parameter: None
          • Response example:

                HTTP/1.1 200 OK 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                Date: Fri, 03 Jul 2015 09:28:13 GMT 
                Transfer-Encoding: chunked 
                Content-Type: application/json;charset=UTF-8 
                Cache-Control: no-cache

          Notification List

          Request

          • Request syntax:

                GET /v{version}/notification HTTP/1.1 
                accept-encoding: gzip, deflate 
                x-bce-date: {utc-date-string} 
                host: media.bj.baidubce.com 
                accept: */* 
                connection: keep-alive 
                x-bce-request-id: {bce-request-id} 
                content-type: application/json
                authorization: {bce-authorization-string} 
          • Request header: No special Header parameter
          • Request parameter: None
          • Request example:

                GET /v3/notification HTTP/1.1 
                content-length: 0
                accept-encoding: gzip, deflate 
                x-bce-date: 2015-07-03T09:28:13Z 
                connection: keep-alive 
                accept: */* 
                user-agent: python-requests/2.4.0 CPython/2.7.9 Darwin/14.3.0 
                host: media.bj.baidubce.com 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                content-type: application/json
                authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03T09:28:13Z/1800/content-type;host;x-bce-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715 

          Response

          • Response header: No special Header parameter
          • Response parameter:
          Field name Field type Field description
          notifications Object Notification list
          + name String Notification name
          + endpoint String Receiving address of notification message
          • Response example:

                HTTP/1.1 200 OK 
                x-bce-request-id: 8776558c-81d9-4f97-8e2c-f977a286095d
                Date: Fri, 03 Jul 2015 09:28:13 GMT 
                Transfer-Encoding: chunked 
                Content-Type: application/json;charset=UTF-8 
                Cache-Control: no-cache
                  
                { 
                  "notifications" : [ { 
                    "name" : "mct_notification", 
                    "endpoint" : "http://mct.notificaitonDomain.com/" 
                  }, { 
                    "name" : "my_notification", 
                    "endpoint" : "http://my.notificaitonDomain.com/" 
                  } ] 
                }
          Previous
          Watermark-API
          Next
          Thumbnail-Preset-API