{"swagger":"2.0","info":{"title":"Event Ingestion Service","description":"This service is responsible of ingesting events in the most appropriates priority queues used by the Event Validation Service.","version":"1.0.0","contact":{"name":"Consumer-IoT team","email":"luis.carvalho@vodafone.com"}},"host":"smartcom-event-ingestion.smartlife.vodafone.com","schemes":["https"],"basePath":"/api/v1","produces":["application/json"],"tags":[{"name":"Events","description":"Everything about events from partner devices."},{"name":"Actions","description":"Everything about actions responses to the platform."}],"paths":{"/events":{"post":{"operationId":"ingestEvent","summary":"Allows the ingestion of an event.","parameters":[{"name":"Accept","in":"header","description":"The Accept request HTTP header advertises which content types, expressed as MIME types, the client is able to understand.","required":true,"type":"string","enum":["application/json"]},{"name":"Content-Type","in":"header","description":"The Content-Type entity header is used to indicate the media type of the resource provided in input.","required":true,"type":"string","enum":["application/json; charset=UTF-8"]},{"name":"Content-Length","in":"header","description":"The Content-Length entity header indicates the size of the entity-body, in bytes, sent to the recipient.","required":true,"type":"integer"},{"name":"vf-event-resource-id","in":"header","description":"The identifier of the resource part of the event. (i.e. the deviceUid/IMEI)","required":true,"type":"string"},{"name":"vf-event-timestamp","in":"header","description":"The timestamp of creation for the event in UTC time following the ISO 8601 format [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z.","required":true,"type":"string"},{"name":"vf-event-type","in":"header","description":"The event type.","required":true,"type":"string"},{"name":"vf-trace-transaction-id","in":"header","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.","required":false,"type":"string"},{"name":"request body","in":"body","description":"Request event payload.","schema":{"$ref":"#/definitions/PostEventRequest"}}],"tags":["Events"],"responses":{"202":{"description":"Accepted","schema":{"$ref":"#/definitions/PostEventResponse"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/HTTP_400_InvalidPayload_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/HTTP_401_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"405":{"description":"Method Not Allowed","schema":{"$ref":"#/definitions/HTTP_405_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"406":{"description":"Not Acceptable","schema":{"$ref":"#/definitions/HTTP_406_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"413":{"description":"Payload Too Large","schema":{"$ref":"#/definitions/HTTP_413_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"415":{"description":"Unsupported Media Type","schema":{"$ref":"#/definitions/HTTP_415_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/HTTP_500_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"502":{"description":"Bad Gateway","schema":{"$ref":"#/definitions/HTTP_502_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"503":{"description":"Service Unavailable","schema":{"$ref":"#/definitions/HTTP_503_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"504":{"description":"Gateway Timeout","schema":{"$ref":"#/definitions/HTTP_504_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}}}}},"/actions":{"post":{"operationId":"ingestAction","summary":"Allows the ingestion of an action acknowledge event.","parameters":[{"name":"Accept","in":"header","description":"The Accept request HTTP header advertises which content types, expressed as MIME types, the client is able to understand.","required":true,"type":"string","enum":["application/json"]},{"name":"Content-Type","in":"header","description":"The Content-Type entity header is used to indicate the media type of the resource provided in input.","required":true,"type":"string","enum":["application/json"]},{"name":"Content-Length","in":"header","description":"The Content-Length entity header indicates the size of the entity-body, in bytes, sent to the recipient.","required":true,"type":"integer"},{"name":"vf-action-id","in":"header","description":"The identifier of the action.","required":true,"type":"string"},{"name":"vf-action-resource-id","in":"header","description":"The identifier of the resource part of the action reponse.","required":true,"type":"string"},{"name":"vf-action-timestamp","in":"header","description":"The timestamp of creation for the event in UTC time following the ISO 8601 format [YYYY]-[MM]-[DD]T[hh]:[mm]:[ss].[sss]Z.","required":true,"type":"string"},{"name":"vf-action-type","in":"header","description":"The action type.","required":true,"type":"string","enum":["actionCompleted","actionFailed","actionStateChangeFailed"]},{"name":"vf-action-name","in":"header","description":"The action name.","required":false,"type":"string"},{"name":"vf-trace-transaction-id","in":"header","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.","required":false,"type":"string"},{"name":"request body","in":"body","description":"Request event payload.","schema":{"$ref":"#/definitions/PostActionRequest"}}],"tags":["Actions"],"responses":{"202":{"description":"Accepted","schema":{"$ref":"#/definitions/PostActionResponse"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/HTTP_400_InvalidPayload_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/HTTP_401_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"405":{"description":"Method Not Allowed","schema":{"$ref":"#/definitions/HTTP_405_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"406":{"description":"Not Acceptable","schema":{"$ref":"#/definitions/HTTP_406_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"413":{"description":"Payload Too Large","schema":{"$ref":"#/definitions/HTTP_413_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned.'"}}},"415":{"description":"Unsupported Media Type","schema":{"$ref":"#/definitions/HTTP_415_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"500":{"description":"Internal Server Error","schema":{"$ref":"#/definitions/HTTP_500_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"502":{"description":"Bad Gateway","schema":{"$ref":"#/definitions/HTTP_502_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"503":{"description":"Service Unavailable","schema":{"$ref":"#/definitions/HTTP_503_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}},"504":{"description":"Gateway Timeout","schema":{"$ref":"#/definitions/HTTP_504_Error"},"headers":{"vf-trace-transaction-id":{"type":"string","description":"A unique transaction ID used for logging and end-to-end tracing. If none is provided, a new one is generated and returned."}}}}}}},"definitions":{"Home":{"type":"object","properties":{"_links":{"type":"object","properties":{"self":{"type":"object","properties":{"href":{"type":"string","example":"http://event-ingestion.smartlife.vodafone.com/api/v1/"}}},"ingest-events":{"type":"object","properties":{"href":{"type":"string","example":"http://event-ingestion.smartlife.vodafone.com/api/v1/events"},"method":{"type":"string","example":"POST"}}},"ingest-actions":{"type":"object","properties":{"href":{"type":"string","example":"http://event-ingestion.smartlife.vodafone.com/api/v1/actions"},"method":{"type":"string","example":"POST"}}}}}}},"PostEventRequest":{"type":"object","example":{"activityGoalReached":{"minutes":60,"steps":6000,"distance":6,"percentage":100,"timestamp":"2020-04-20T19:30:16+00:00"}}},"PostEventResponse":{"type":"object","required":["eventId"],"properties":{"eventId":{"type":"string","example":"e28f199c-8d75-4a86-9fd2-40ab97ed36c9","description":"The identifier of the event processed by the CIOT platform. The value must be a UUID v4."}}},"PostActionRequest":{"type":"object","example":{"code":"invalid_token","reason":"Invalid access token for the provided customer.","custom":{"accessToken":"d0f01qa4-aaa6-4f8c-zzf1-7cf7e7c2af41"}}},"PostActionResponse":{"type":"object","required":["actionId"],"properties":{"actionId":{"type":"string","example":"e28f199c-8d75-4a86-9fd2-40ab97ed36c9","description":"The identifier of the event processed by the CIOT platform. The value must be a UUID v4."}}},"HTTP_400_InvalidPayload_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"invalid_request"},"reason":{"type":"string","example":"Invalid Request Payload"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/400"}}},"HTTP_401_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"unauthorized"},"reason":{"type":"string","example":"Unauthorized"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/401"}}},"HTTP_405_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"method_not_allowed"},"reason":{"type":"string","example":"Method Not Allowed"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/405"}}},"HTTP_406_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"invalid_accept_type"},"reason":{"type":"string","example":"The Accept header is invalid"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/405"}}},"HTTP_413_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"payload_too_large"},"reason":{"type":"string","example":"Payload Too Large"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/413"}}},"HTTP_415_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"unsupported_media_type"},"reason":{"type":"string","example":"Unsupported Media Type"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/415"}}},"HTTP_500_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"internal_server_error"},"reason":{"type":"string","example":"Internal Server Error"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/500"}}},"HTTP_502_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"bad_gateway"},"reason":{"type":"string","example":"Bad Gateway"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/502"}}},"HTTP_503_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"service_unavailable"},"reason":{"type":"string","example":"Service Unavailable"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/503"}}},"HTTP_504_Error":{"type":"object","required":["code","reason","referenceError"],"properties":{"code":{"type":"string","example":"gateway_timeout"},"reason":{"type":"string","example":"Gateway Timeout"},"message":{"type":"object","properties":{"description":{"type":"string","example":"Detailed description of the failure"}}},"referenceError":{"type":"string","example":"https://eventsingestion.v.vodafone.com/errors/504"}}}}}