openapi: 3.0.0 info: title: Timezynk integration bridge API version: 0.1.1 servers: - url: / tags: - description: Synk data from a data source to a Timezynk registry. name: Source - description: Synk data from a Timezynk registry to a data sink. name: Sink paths: /data-sources: get: responses: 200: content: application/json: schema: $ref: '#/components/schemas/DataSource' description: Success. 401: description: Unauthorized. 500: description: Unexpected error. summary: List registered datasources tags: - Source post: requestBody: content: application/json: schema: $ref: '#/components/schemas/DataSource' responses: 200: content: application/json: schema: $ref: '#/components/schemas/DataSource' description: Success. 400: description: Bad Request. Data provided in request body is invalid. 401: description: Unauthorized. 409: description: Conflict. A data source with the provided id is already existing. 500: description: Unexpected error. summary: Register a data source tags: - Source /data-sources/{dataSourceId}/synchronization-state: get: parameters: - description: Id of the data source explode: false in: path name: dataSourceId required: true schema: type: string style: simple responses: 200: content: application/json: schema: items: $ref: '#/components/schemas/SynchronizationState' type: array description: Success. 401: description: Unauthorized. 500: description: Unexpected error. summary: Lists synchronization status for your data sources tags: - Source /data-sources/{dataSourceId}/entities/{entityId}/changes: post: parameters: - description: Id of the data source explode: false in: path name: dataSourceId required: true schema: type: string style: simple - description: Id of the entity explode: false in: path name: entityId required: true schema: type: string style: simple requestBody: content: application/json: schema: items: $ref: '#/components/schemas/DataSource' type: array responses: 200: content: application/json: schema: $ref: '#/components/schemas/DataSource' description: Success. 400: description: Bad Request. Data provided in request body is invalid. 401: description: Unauthorized. 500: description: unexpected error. summary: Sync changes from data source tags: - Source components: schemas: DataSource: example: company-id: company-id entities: - timestamp-key: timestamp-key name: name id: id field-key: field-key fields: - name: name format: format id: id type: string required: true - name: name format: format id: id type: string required: true last-sync: 0 last-update: 6 - timestamp-key: timestamp-key name: name id: id field-key: field-key fields: - name: name format: format id: id type: string required: true - name: name format: format id: id type: string required: true last-sync: 0 last-update: 6 name: name id: id properties: id: description: id of the source type: string name: description: name of the source type: string company-id: description: id of the company that owns this data type: string entities: description: list of available entities items: $ref: '#/components/schemas/Entity' type: array required: - company-id - entities - id - name DataSink: allOf: - $ref: '#/components/schemas/DataSource' Entity: example: timestamp-key: timestamp-key name: name id: id field-key: field-key fields: - name: name format: format id: id type: string required: true - name: name format: format id: id type: string required: true last-sync: 0 last-update: 6 properties: id: description: id of the entity type: string name: description: title of the entity type: string fields: description: list of available entities items: $ref: '#/components/schemas/Field' type: array field-key: description: Identifies a unique field which will be used as key (id) for the entity rows. type: string timestamp-key: description: Identifies a timestamp field which will be used to calculate the most recent updated synced entry. type: string last-sync: description: Timestamp in ms of the latest sync. format: int64 readOnly: true type: integer last-update: description: Timestamp in of the latest updated entry format: int64 readOnly: true type: integer required: - field-key - fields - id - name - timestamp-key Field: example: name: name format: format id: id type: string required: true properties: id: description: id of the field type: string name: description: title of the field type: string type: description: the value json data type enum: - string - number - boolean type: string format: description: how to value should be formatted type: string required: default: true description: indicates if this field is required type: boolean required: - id - name - required - type EntitySettings: properties: company-id: description: id of the company that owns this data type: string source-id: description: Id of the source which contains the entity. type: string entity-id: description: Id of the entity id to map fields. type: string collection-id: description: Id of the Timezynk collection to map fields. E.g. a registry id or invoices format: ObjectId type: string sync-interval: description: Duration of the sync interval entered in ms. format: int64 type: integer field-mapping: description: list of field mapping items: $ref: '#/components/schemas/FieldSettings' type: array required: - collection-id - company-id - entity-id - field-mapping - source-id - sync-interval FieldSettings: properties: entity-field-id: description: Id of the entity field to map. type: string collection-field-id: description: Id of the Timezynk collection field to map. type: string required: - collection-field-id - entity-field-id SynchronizationState: example: sync-interval: 6 last-sync: 0 entity-id: entity-id last-update: last-update properties: entity-id: description: Id of the entity. type: string last-sync: description: Timestamp in ms of the latest sync. format: int64 type: integer last-update: description: Token the client can use to determine the last synchronized updates type: string sync-interval: description: Duration of the sync interval entered in ms. format: int64 type: integer required: - entity-id - last-sync - last-update - sync-interval