{"swagger":"2.0","info":{"description":"This is a Api documentation for backchannel framework","version":"0.0.1","title":"1RPP-BackChannel"},"host":"localhost:60041","basePath":"/api","tags":[{"name":"Gateway","description":"Operations available for background jobs"}],"schemes":["http","https"],"securityDefinitions":{"Bearer":{"type":"apiKey","name":"Authorization","in":"header"}},"paths":{"/messages":{"post":{"security":[{"Bearer":[]}],"tags":["Gateway"],"summary":"register background job","description":"Register a background job which is related to defined message","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"header","name":"Authorization","description":"An access token is an opaque string which is passed in request header which identifies a user, and authenticate user and request to make API calls.","type":"string"},{"in":"body","name":"requestPayload","description":"Request body object which contains message to register, isCallBack true if message status expected and false if not, jsonObject will be  passed as a input to background job.","required":true,"schema":{"$ref":"#/definitions/RequestPayload"}}],"responses":{"202":{"description":"Request accepted to register a message"},"400":{"description":"Bad input parameter"},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/Error"}}}},"get":{"security":[{"Bearer":[]}],"tags":["Gateway"],"summary":"retrive id of running and succeeded messages","description":"All message ids and message name from all jobs which are currently in progress and that of already succeeded and also whose response is not served yet would be fetch","produces":["application/json"],"parameters":[{"in":"header","name":"Authorization","description":"An access token is an opaque string which is passed in request header which identifies a user, and authenticate user and request to make API calls.","type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/MessageIds"}},"400":{"description":"Bad input parameter"},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/Error"}}}}},"/messages/{id}":{"get":{"security":[{"Bearer":[]}],"tags":["Gateway"],"summary":"fetch status by given message id","description":"By passing id as messageId, all activities initiated by this message will be served. The response which served once will not be served again for same user and client.","produces":["application/json"],"parameters":[{"in":"header","name":"Authorization","description":"An access token is an opaque string which is passed in request header which identifies a user, and authenticate user and request to make API calls.","type":"string"},{"in":"path","name":"id","description":"message id","type":"string","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/MessageId"}},"204":{"description":"No content available"},"400":{"description":"Bad input parameter"},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/Error"}}}}},"/channels/{channelName}/subscribe":{"get":{"security":[{"Bearer":[]}],"tags":["Gateway"],"summary":"fetch result published for requested channel","description":"fetch channel payload","parameters":[{"in":"header","name":"Authorization","description":"An access token is an opaque string which is passed in request header which identifies a user, and authenticate user and request to make API calls.","type":"string"},{"in":"path","name":"channelName","description":"channel name","type":"string","required":true}],"responses":{"200":{"description":"Result fetch","schema":{"$ref":"#/definitions/ChannelPayload"}},"204":{"description":"No content available"},"400":{"description":"Bad input parameter"},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/Error"}}}}}},"definitions":{"RequestPayload":{"type":"object","properties":{"message":{"type":"string","example":"registration"},"isCallback":{"type":"boolean","example":true},"requestBody":{"type":"object","example":"{\"Name\":\"UserId001\",\"IsActive\":false}"}}},"MessageIds":{"type":"array","items":{"type":"object","properties":{"messageId":{"type":"integer","example":1},"name":{"type":"string","example":"registration"}}}},"MessageId":{"type":"object","properties":{"messageId":{"type":"integer","example":1},"name":{"type":"string","example":"vat"},"state":{"type":"string","example":"Succeeded"},"queue":{"type":"string","example":"default"},"submittedTime":{"type":"string","example":"2018-11-14T07:41:04.493"},"input":{"type":"string","example":"{\"Name\": \"UserId001\",\"IsActive\": false}"},"output":{"type":"string","example":"{\"Name\":\"job4\",\"IsActive\":true}"},"startTime":{"type":"string","example":"2019-02-28T06:47:18.713"},"endTime":{"type":"string","example":"2019-02-28T06:47:22.303"},"events":{"type":"array","items":{"$ref":"#/definitions/ActivityModel"}}}},"ActivityModel":{"type":"object","properties":{"eventId":{"type":"integer","example":21},"eventPrefix":{"type":"string","example":"e1_"},"activityName":{"type":"string","example":"act1"},"state":{"type":"string","example":"Succeeded"},"input":{"type":"string","example":"[{\"PreviousActivity\":null,\"Result\":\"{\"Name\":\"UserId001\",\"IsActive\":false}\"}]"},"output":{"type":"string","example":"{\"Name\":\"UserId001\",\"IsActive\":true}"},"startTime":{"type":"string","example":"2019-02-28T06:47:18.713"},"endTime":{"type":"string","example":"2019-02-28T06:47:22.303"},"errorMessage":{"type":"string","example":null}}},"ChannelPayload":{"type":"array","items":{"type":"object","properties":{"publicationId":{"type":"integer","example":25},"channelName":{"type":"string","example":"channel1"},"publishedOn":{"type":"string","example":"2018-11-14T07:41:04.493"},"result":{"type":"string","example":"{\"channelResponse\":\"Response\",\"isActive\":false}"}}}},"Error":{"properties":{"error":{"type":"object","example":"error message"}}}}}