PowerPlatformConnectors/certified-connectors/Exact Online Premium/apiDefinition.swagger.json

970 строки
26 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "Exact Online Premium",
"description": "Connect to your Exact Online Premium account and get notified when business entities are created or updated.\n\nCurrently supported entities are Sales Orders, Projects, Accounts and Opportunities.\n\nMore entities and events will be added in the future.",
"contact": {
"name": "Exact",
"url": "https://www.exact.com"
},
"version": "3.0"
},
"host": "start.exactonline.nl",
"basePath": "/api/v1",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/current/Me": {
"get": {
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/UserData"
}
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"summary": "Get user data",
"description": "This gets basic information about the signed in user.",
"operationId": "GetUserData",
"x-ms-visibility": "internal",
"parameters": [
{
"$ref": "#/parameters/AcceptHeader"
}
]
}
},
"/webhooks/EntityChanged": {
"x-ms-notification-content": {
"schema": {
"$ref": "#/definitions/EntityChangedEvent"
},
"headers": {
"Location": {
"description": "The unsubscribe URL for the current event.",
"type": "string"
}
},
"description": "A notification that a business entity is created or changed."
},
"post": {
"x-ms-trigger": "single",
"summary": "When a business entity record is created or changed",
"description": "This subscribes to create or change events for a selected business entity.",
"operationId": "SubscribeEntityChanged",
"parameters": [
{
"$ref": "#/parameters/SubscriptionBodyWithEntityType"
}
],
"responses": {
"201": {
"$ref": "#/responses/SubscriptionCreated"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "internal"
}
},
"/webhooks/AccountChanged": {
"x-ms-notification-content": {
"schema": {
"$ref": "#/definitions/EntityChangedEvent"
},
"headers": {
"Location": {
"description": "The unsubscribe URL for the current event.",
"type": "string"
}
},
"description": "A notification that an account is created or changed."
},
"post": {
"x-ms-trigger": "single",
"summary": "When an account is created or changed",
"description": "This subscribes to create or change events for accounts.",
"operationId": "SubscribeAccountChanged",
"parameters": [
{
"$ref": "#/parameters/SubscriptionBody"
}
],
"responses": {
"201": {
"$ref": "#/responses/SubscriptionCreated"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "important"
}
},
"/webhooks/OpportunityChanged": {
"x-ms-notification-content": {
"schema": {
"$ref": "#/definitions/EntityChangedEvent"
},
"headers": {
"Location": {
"description": "The unsubscribe URL for the current event.",
"type": "string"
}
},
"description": "A notification that an opportunity is created or changed."
},
"post": {
"x-ms-trigger": "single",
"summary": "When an opportunity is created or changed",
"description": "This subscribes to create or change events for opportunities.",
"operationId": "SubscribeOpportunityChanged",
"parameters": [
{
"$ref": "#/parameters/SubscriptionBody"
}
],
"responses": {
"201": {
"$ref": "#/responses/SubscriptionCreated"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "important"
}
},
"/webhooks/ProjectChanged": {
"x-ms-notification-content": {
"schema": {
"$ref": "#/definitions/EntityChangedEvent"
},
"headers": {
"Location": {
"description": "The unsubscribe URL for the current event.",
"type": "string"
}
},
"description": "A notification that a project is created or changed."
},
"post": {
"x-ms-trigger": "single",
"summary": "When a project is created or changed",
"description": "This subscribes to create or change events for projects.",
"operationId": "SubscribeProjectChanged",
"parameters": [
{
"$ref": "#/parameters/SubscriptionBody"
}
],
"responses": {
"201": {
"$ref": "#/responses/SubscriptionCreated"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "important"
}
},
"/webhooks/SalesOrderChanged": {
"x-ms-notification-content": {
"schema": {
"$ref": "#/definitions/EntityChangedEvent"
},
"headers": {
"Location": {
"description": "The unsubscribe URL for the current event.",
"type": "string"
}
},
"description": "A notification that a sales order is created or changed."
},
"post": {
"x-ms-trigger": "single",
"summary": "When a sales order is created or changed",
"description": "This subscribes to create or change events for sales orders.",
"operationId": "SubscribeSalesOrderChanged",
"parameters": [
{
"$ref": "#/parameters/SubscriptionBody"
}
],
"responses": {
"201": {
"$ref": "#/responses/SubscriptionCreated"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "important"
}
},
"/webhooks/WebhookSubscriptions": {
"get": {
"summary": "Get existing subscriptions for user",
"description": "Get the active webhook subscriptions for this user.",
"operationId": "GetWebhookSubscriptions",
"x-ms-visibility": "internal",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/SubscriptionCollection"
}
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-openai-data": {
"openai-enabled": false,
"operations": [
{
"operationId": "GetWebhookSubscriptions",
"x-ms-require-user-confirmation": false
}
]
}
}
},
"/system/Companies": {
"get": {
"summary": "Get companies for user",
"description": "This gets the list of companies the user is assigned to.",
"operationId": "GetCompanies",
"x-ms-visibility": "internal",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CompanyCollection"
}
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-openai-data": {
"openai-enabled": false,
"operations": [
{
"operationId": "GetCompanies",
"x-ms-require-user-confirmation": false
}
]
}
}
},
"/system/EntityTypes": {
"get": {
"summary": "Get supported entity types",
"description": "This gets the list of supported entity types for the triggers.",
"operationId": "GetSupportedEntityTypes",
"x-ms-visibility": "internal",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/EntityTypeCollection"
}
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
}
}
},
"/system/Schema": {
"get": {
"summary": "Get schema definition",
"description": "This gets the schema definition for a selected entity and value type.",
"operationId": "GetSchema",
"x-ms-visibility": "internal",
"parameters": [
{
"$ref": "#/parameters/EntityTypeFromQuery"
},
{
"$ref": "#/parameters/ValueTypeFromQuery"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object"
},
"items": {
"type": "object"
}
},
"required": [
"type"
]
}
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-openai-data": {
"openai-enabled": false,
"operations": [
{
"operationId": "GetSchema",
"x-ms-require-user-confirmation": false
}
]
}
}
},
"/{companyid}/webhooks/WebhookSubscriptions(guid'{subscriptionid}')": {
"delete": {
"summary": "Unsubscribe from event",
"description": "This unregisters an active event subscription.",
"operationId": "Unsubscribe",
"parameters": [
{
"name": "companyid",
"in": "path",
"required": true,
"type": "integer",
"format": "int32",
"description": "The company ID for which the unsubscribe is requested.",
"x-ms-summary": "Company ID",
"x-ms-url-encoding": "single"
},
{
"name": "subscriptionid",
"in": "path",
"required": true,
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-(?:[0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$",
"description": "The subscription ID that needs to be unsubscribed.",
"x-ms-summary": "Subscription ID",
"x-ms-url-encoding": "single"
}
],
"security": [
{
"oauth2-auth": []
}
],
"responses": {
"200": {
"description": "OK"
},
"204": {
"$ref": "#/responses/NoContent"
},
"400": {
"$ref": "#/responses/BadRequest"
},
"401": {
"$ref": "#/responses/Unauthorized"
},
"403": {
"$ref": "#/responses/Forbidden"
},
"404": {
"$ref": "#/responses/NotFound"
},
"500": {
"$ref": "#/responses/InternalServerError"
}
},
"x-ms-visibility": "internal",
"x-ms-openai-data": {
"openai-enabled": false,
"operations": [
{
"operationId": "Unsubscribe",
"x-ms-require-user-confirmation": true
}
]
}
}
},
"/convert/PayloadToValues": {
"patch": {
"responses": {
"200": {
"description": "OK",
"schema": {
"x-ms-dynamic-schema": {
"operationId": "GetSchema",
"parameters": {
"EntityType": {
"parameter": "EntityType"
},
"ValueType": {
"parameter": "ValueType"
}
}
},
"x-ms-dynamic-properties": {
"operationId": "GetSchema",
"parameters": {
"EntityType": {
"parameterReference": "EntityType"
},
"ValueType": {
"parameterReference": "ValueType"
}
}
},
"type": "object",
"properties": {}
},
"headers": {
"Content-Type": {
"description": "Content-Type",
"type": "string"
}
}
}
},
"summary": "Get values",
"consumes": [ "text/plain", "application/json" ],
"description": "This loads the values from the trigger's Payload field in a format of choice.",
"operationId": "GetValues",
"parameters": [
{
"$ref": "#/parameters/ContentTypeHeader"
},
{
"$ref": "#/parameters/AcceptHeader"
},
{
"$ref": "#/parameters/EntityTypeFromQuery"
},
{
"$ref": "#/parameters/ValueTypeFromQuery"
},
{
"name": "body",
"in": "body",
"required": false,
"description": "Add reference to Payload field here",
"x-ms-summary": "Payload",
"x-ms-visibility": "advanced",
"schema": {
"type": "string",
"default": "@{triggerOutputs()?['body/Content/Payload']}"
}
}
],
"x-ms-openai-data": {
"openai-enabled": false,
"operations": [
{
"operationId": "GetValues",
"x-ms-require-user-confirmation": true
}
]
},
"x-ms-visibility": "important"
}
}
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://www.exact.com"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://www.exact.com/trust/privacy/privacy-statement"
},
{
"propertyName": "Categories",
"propertyValue": "Collaboration;Commerce"
}
],
"definitions": {
"guidText": {
"pattern": "^[0-9A-Fa-f]{8}-(?:[0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$",
"type": "string",
"example": "40237952-a798-f72c-de82-123bdc78a0f9"
},
"UserData": {
"description": "User data definition",
"type": "object",
"properties": {
"CurrentDivision": {
"x-ms-summary": "Current company",
"type": "integer",
"format": "int32"
},
"UserID": {
"type": "string"
}
},
"example": {
"CurrentDivision": 123456,
"UserID": "0bcf7c37-a5e2-4612-9b88-687ce0d6c5ed"
}
},
"Company": {
"description": "A company definition",
"type": "object",
"properties": {
"Code": {
"type": "integer",
"format": "int32"
},
"Description": {
"type": "string"
}
},
"example": {
"Code": 123456,
"Description": "User Company 1"
}
},
"CompanyCollection": {
"description": "A collection of company definitions",
"type": "array",
"items": {
"$ref": "#/definitions/Company"
},
"example": [
{
"Code": 123456,
"Description": "User Company 1"
}
]
},
"EntityType": {
"description": "An entity type definition",
"type": "object",
"properties": {
"Name": {
"type": "string"
},
"Topic": {
"type": "string"
}
},
"example": {
"Name": "Account",
"Topic": "PowerAutomateAccounts"
}
},
"EntityTypeCollection": {
"description": "A collection of entity type definitions",
"type": "array",
"items": {
"$ref": "#/definitions/EntityType"
},
"example": [
{
"Name": "Account",
"Topic": "PowerAutomateAccounts"
},
{
"Name": "Project",
"Topic": "PowerAutomateProjects"
}
]
},
"Subscription": {
"description": "A webhook subscription",
"type": "object",
"properties": {
"ClientID": {
"type": "string"
},
"Created": {
"type": "string"
},
"Creator": {
"$ref": "#/definitions/guidText"
},
"CreatorFullName": {
"type": "string"
},
"Description": {
"type": "string"
},
"Division": {
"x-ms-summary": "Company",
"type": "integer",
"format": "int32",
"description": "Company"
},
"ID": {
"$ref": "#/definitions/guidText"
},
"CallbackURL": {
"type": "string"
},
"Topic": {
"type": "string"
},
"UserID": {
"$ref": "#/definitions/guidText"
}
},
"example": {
"ClientID": null,
"Created": "2023-12-04T16:33:26.077Z",
"Creator": "e0cac7c0-780f-472f-ae05-c21c19c4a6ba",
"CreatorFullName": "Webhook Creator",
"Description": "Exact Online Premium Power Automate Connector",
"Division": 123456,
"ID": "7ce5541e-1a7c-4be9-8039-7f1b998e5be6",
"CallbackURL": "https://",
"Topic": "PowerAutomateSalesOrders",
"UserID": "0bcf7c37-a5e2-4612-9b88-687ce0d6c5ed"
}
},
"SubscriptionCollection": {
"description": "A collection of webhook subscriptions",
"type": "array",
"items": {
"$ref": "#/definitions/Subscription"
},
"example": [
{
"ClientID": null,
"Created": "2023-12-04T16:33:26.077Z",
"Creator": "e0cac7c0-780f-472f-ae05-c21c19c4a6ba",
"CreatorFullName": "Webhook Creator",
"Description": "Exact Online Premium Power Automate Connector",
"Division": 123456,
"ID": "7ce5541e-1a7c-4be9-8039-7f1b998e5be6",
"CallbackURL": "https://",
"Topic": "PowerAutomateSalesOrders",
"UserID": "0bcf7c37-a5e2-4612-9b88-687ce0d6c5ed"
}
]
},
"EntityChangedEvent": {
"type": "object",
"properties": {
"Content": {
"$ref": "#/definitions/ChangeEventContent"
},
"HashCode": {
"type": "string"
}
},
"example": {
"Content": {
"Topic": "PowerAutomateSalesOrders",
"ClientId": "6e323505-31c4-4d4a-a164-cc4fde36e4b5",
"Division": 123456,
"Action": "Update",
"Key": "9907a65d-60b0-43dd-a215-8d3c2e0f2a32",
"ExactOnlineEndpoint": "https://start.exactonline.nl/api/v1/123456/salesorder/SalesOrders(guid'9907a65d-60b0-43dd-a215-8d3c2e0f2a32')",
"EventCreatedOn": "2023-11-02T10:49:37.87",
"Payload": "{}"
},
"HashCode": "67AFE76FEA7E"
}
},
"ChangeEventContent": {
"type": "object",
"properties": {
"Topic": {
"type": "string"
},
"ClientId": {
"$ref": "#/definitions/guidText"
},
"Division": {
"x-ms-summary": "Company",
"type": "integer",
"format": "int32",
"description": "Company"
},
"Action": {
"type": "string"
},
"Key": {
"$ref": "#/definitions/guidText"
},
"ExactOnlineEndpoint": {
"type": "string"
},
"EventCreatedOn": {
"type": "string"
},
"Payload": {
"type": "string"
}
}
}
},
"parameters": {
"AcceptHeader": {
"name": "Accept",
"in": "header",
"required": false,
"type": "string",
"default": "application/json",
"description": "Specify the accepted response format.",
"x-ms-summary": "Accept header",
"x-ms-visibility": "advanced"
},
"ContentTypeHeader": {
"name": "Content-Type",
"in": "header",
"required": false,
"type": "string",
"default": "application/json",
"description": "Specify the content type of the payload.",
"x-ms-summary": "Content-Type header",
"x-ms-visibility": "advanced"
},
"EntityTypeFromQuery": {
"name": "EntityType",
"description": "Select the type of business entity for this operation.",
"x-ms-summary": "Entity Type",
"type": "string",
"in": "query",
"required": true,
"x-ms-dynamic-values": {
"operationId": "GetSupportedEntityTypes",
"value-path": "Topic",
"value-title": "Name"
},
"x-ms-visibility": "important"
},
"ValueTypeFromQuery": {
"name": "ValueType",
"description": "Select the value type for this operation.",
"x-ms-summary": "Value Type",
"type": "string",
"in": "query",
"required": true,
"enum": [
"table",
"oldValue",
"newValue"
],
"x-ms-enum-values": [
{
"displayName": "Table",
"value": "table"
},
{
"displayName": "Old Values",
"value": "oldValue"
},
{
"displayName": "New Values",
"value": "newValue"
}
],
"x-ms-visibility": "important"
},
"SubscriptionBody": {
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"CallbackURL": {
"x-ms-notification-url": true,
"x-ms-visibility": "internal",
"type": "string",
"description": "The callback URL on which the current workflow receives its trigger messages."
},
"Company": {
"x-ms-dynamic-values": {
"operationId": "GetCompanies",
"value-path": "Code",
"value-title": "Description"
},
"x-ms-visibility": "important",
"type": "string",
"description": "Select the company for which you want to receive the events."
}
},
"required": [
"CallbackURL",
"Company"
]
}
},
"SubscriptionBodyWithEntityType": {
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"CallbackURL": {
"x-ms-notification-url": true,
"x-ms-visibility": "internal",
"type": "string",
"description": "The callback URL on which the current workflow receives its trigger messages."
},
"Company": {
"x-ms-dynamic-values": {
"operationId": "GetCompanies",
"value-path": "Code",
"value-title": "Description"
},
"x-ms-visibility": "important",
"type": "string",
"description": "Select the company for which you want to receive the events."
},
"EntityType": {
"x-ms-dynamic-values": {
"operationId": "GetSupportedEntityTypes",
"value-path": "Topic",
"value-title": "Name"
},
"x-ms-visibility": "important",
"type": "string",
"description": "Select the type of business entity for which you want to receive the events."
}
},
"required": [
"CallbackURL",
"Company",
"EntityType"
]
}
}
},
"responses": {
"SubscriptionCreated": {
"description": "Created",
"schema": {
"$ref": "#/definitions/Subscription"
}
},
"NoContent": {
"description": "No Content"
},
"BadRequest": {
"description": "Bad Request"
},
"Unauthorized": {
"description": "Unauthorized"
},
"Forbidden": {
"description": "Forbidden"
},
"NotFound": {
"description": "Not Found"
},
"InternalServerError": {
"description": "Internal Server Error"
}
},
"securityDefinitions": {
"oauth2-auth": {
"type": "oauth2",
"flow": "accessCode",
"authorizationUrl": "https://start.exactonline.nl/api/oauth2/auth",
"tokenUrl": "https://start.exactonline.nl/api/oauth2/token",
"scopes": {}
}
},
"security": [
{
"oauth2-auth": []
}
],
"tags": []
}