{"openapi":"3.0.0","info":{"title":"Callback Example","version":"1.0.0"},"paths":{"/streams":{"post":{"description":"subscribes a client to receive out-of-band data","parameters":[{"name":"callbackUrl","in":"query","required":true,"description":"the location where data will be sent. Must be network accessible\nby the source server\n","schema":{"type":"string","format":"uri","example":"https://tonys-server.com"}}],"responses":{"201":{"description":"subscription successfully created","content":{"application/json":{"schema":{"description":"subscription information","required":["subscriptionId"],"properties":{"subscriptionId":{"description":"this unique identifier allows management of the subscription","type":"string","example":"2531329f-fb09-4ef7-887e-84e648214436"}}}}}}},"callbacks":{"onData":{"{$request.query.callbackUrl}/data":{"post":{"requestBody":{"description":"subscription payload","content":{"application/json":{"schema":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"userData":{"type":"string"}}}}}},"responses":{"202":{"description":"Your server implementation should return this HTTP status code\nif the data was received successfully\n"},"204":{"description":"Your server should return this HTTP status code if no longer interested\nin further updates\n"}}}}}}}}}}
YAML
openapi:3.0.0info:title:Callback Exampleversion:1.0.0paths:/streams:post:description:subscribes a client to receive out-of-band dataparameters:-name:callbackUrlin:queryrequired:truedescription:|the location where data will be sent. Must be network accessibleby the source serverschema:type:stringformat:uriexample:https://tonys-server.comresponses:'201':description:subscription successfully createdcontent:application/json:schema:description:subscription informationrequired:-subscriptionIdproperties:subscriptionId:description:this unique identifier allows management of the subscriptiontype:stringexample:2531329f-fb09-4ef7-887e-84e648214436callbacks:# the name `onData` is a convenience locatoronData:# when data is sent, it will be sent to the `callbackUrl` provided# when making the subscription PLUS the suffix `/data`'{$request.query.callbackUrl}/data':post:requestBody:description:subscription payloadcontent:application/json:schema:type:objectproperties:timestamp:type:stringformat:date-timeuserData:type:stringresponses:'202':description:|Your server implementation should return this HTTP status codeif the data was received successfully'204':description:|Your server should return this HTTP status code if no longer interestedin further updates