PowerPlatformConnectors/custom-connectors/Infobip/apiDefinition.swagger.json

626 строки
19 KiB
JSON

{
"swagger": "2.0",
"info": {
"version": "1.1",
"title": "Infobip",
"description": "Provide SMS and VOICE communication channels for enterprises over Infobip platform to better their customer engagement.",
"x-ms-api-annotation": {
"status": "Preview"
},
"contact": {
"email": "Partnership_PresalesHQ@infobip.com",
"name": "Infobip",
"url": "https://www.infobip.com/"
}
},
"host": "api.infobip.com",
"basePath": "/",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/sms/1/webhooks": {
"x-ms-notification-content": {
"description": "Details for incoming text message (SMS).",
"schema": {
"$ref": "#/definitions/WebhookBody"
}
},
"post": {
"description": "This operation triggers when you receive an incoming text message (SMS) on the number you bought from Infobip.",
"summary": "When you receive an incoming text message",
"operationId": "CreateInfobipSMSWebhook",
"x-ms-trigger": "single",
"parameters": [
{
"name": "Request body of webhook",
"in": "body",
"description": "This is the request body of the Webhook.",
"required": true,
"schema": {
"type": "object",
"required": [
"phoneNumber",
"keyword",
"webhookUrl"
],
"properties": {
"phoneNumber": {
"type": "string",
"title": "Phone number",
"description": "Phone number that you have purchased through Infobip platform.",
"x-ms-visibility": "important"
},
"keyword": {
"type": "string",
"title": "Keyword",
"description": "Unique keyword used for this Flow.",
"x-ms-visibility": "important"
},
"webhookUrl": {
"type": "string",
"title": "Webhook url",
"description": "Url that SMS messages will be pushed to.",
"x-ms-notification-url": true,
"x-ms-visibility": "internal"
}
}
}
}
],
"responses": {
"201": {
"description": "Response to successfully created webhook.",
"schema": {
"$ref": "#/definitions/WebhookCreationResponse"
}
},
"default": {
"description": "Response to failed request.",
"x-ms-summary": "Failure response",
"schema": {
"$ref": "#/definitions/FailureResponseBody"
}
}
}
}
},
"/sms/1/webhooks/{webhook_key}": {
"delete": {
"description": "This action will stop the trigger for incoming text messages that you previously registered.",
"summary": "Stop incoming text message trigger",
"operationId": "RemoveInfobipSMSWebhook",
"x-ms-visibility": "internal",
"parameters": [
{
"name": "webhook_key",
"in": "path",
"description": "Key of the webhook to remove.",
"required": true,
"x-ms-visibility": "important",
"type": "string",
"x-ms-url-encoding": "single"
}
],
"responses": {
"204": {
"description": "Response to successfully deleting a webhook."
},
"default": {
"description": "Response to failed request.",
"x-ms-summary": "Failure response",
"schema": {
"$ref": "#/definitions/FailureResponseBody"
}
}
}
}
},
"/sms/1/text/single": {
"post": {
"description": "This action will send an outbound text message (SMS).",
"summary": "Send a text message (SMS)",
"operationId": "SendInfobipSMS",
"x-ms-visibility": "important",
"parameters": [
{
"name": "Request body",
"in": "body",
"description": "Request body.",
"schema": {
"$ref": "#/definitions/SendSMSRequestBody"
}
}
],
"responses": {
"200": {
"description": "Response to successful sending of outbound text message (SMS).",
"x-ms-summary": "Success response",
"schema": {
"$ref": "#/definitions/SendSMSSuccessResponseBody"
}
},
"default": {
"description": "Response to failed sending of outbound text message (SMS).",
"x-ms-summary": "Failure response",
"schema": {
"$ref": "#/definitions/FailureResponseBody"
}
}
}
}
},
"/tts/3/single": {
"post": {
"description": "This action will make an outbound voice call and read your message using text to speech synthesis.",
"summary": "Make a voice call",
"operationId": "MakeInfobipVoiceCall",
"x-ms-visibility": "advanced",
"parameters": [
{
"name": "Request body",
"in": "body",
"description": "Request body.",
"schema": {
"$ref": "#/definitions/VoiceCallRequestBody"
}
}
],
"responses": {
"200": {
"description": "Response to successful voice call.",
"x-ms-summary": "Success response",
"schema": {
"$ref": "#/definitions/VoiceCallSuccessResponseBody"
}
},
"default": {
"description": "Response to failed voice call.",
"x-ms-summary": "Failure response",
"schema": {
"$ref": "#/definitions/FailureResponseBody"
}
}
}
}
},
"/account/1/balance": {
"get": {
"description": "This action will return you the current balance of your account.",
"summary": "Check current balance",
"operationId": "CheckCurrentBalance",
"x-ms-visibility": "advanced",
"parameters": [],
"responses": {
"200": {
"description": "Response to successful check balance request.",
"x-ms-summary": "Success response",
"schema": {
"$ref": "#/definitions/BalanceSuccessResponseBody"
}
},
"default": {
"description": "Response to failed check balance request.",
"x-ms-summary": "Failure response",
"schema": {
"$ref": "#/definitions/FailureResponseBody"
}
}
}
}
}
},
"definitions": {
"InboundSmsMessage": {
"type": "object",
"properties": {
"from": {
"type": "string",
"title": "Sender",
"x-ms-summary": "Sender",
"description": "SMS message sender's phone number.",
"x-ms-visibility": "important"
},
"to": {
"type": "string",
"title": "Destination",
"x-ms-summary": "Destination",
"description": "SMS message's destination phone number.",
"x-ms-visibility": "advanced"
},
"text": {
"type": "string",
"title": "Full text",
"x-ms-summary": "Full text",
"description": "Entire content of the SMS message, contains keyword.",
"x-ms-visibility": "advanced"
},
"cleanText": {
"type": "string",
"title": "Clean text",
"x-ms-summary": "Clean text",
"description": "Text of the SMS message, without keyword.",
"x-ms-visibility": "important"
},
"keyword": {
"type": "string",
"title": "Keyword",
"x-ms-summary": "Keyword",
"description": "Keyword used in the SMS message.",
"x-ms-visibility": "advanced"
},
"receivedAt": {
"type": "string",
"title": "Received at",
"x-ms-summary": "Received at",
"description": "Date and time when SMS message was received.",
"x-ms-visibility": "advanced"
},
"messageId": {
"type": "string",
"title": "Unique message id",
"x-ms-summary": "Unique message id",
"description": "Id that uniquely identifies received SMS message.",
"x-ms-visibility": "internal"
}
}
},
"WebhookBody": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/InboundSmsMessage"
}
}
}
},
"WebhookCreationResponse": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"active": {
"type": "boolean"
},
"events": {
"type": "array",
"items": {
"type": "string"
}
},
"config": {
"type": "object",
"properties": {
"content_type": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"updated_at": {
"type": "string"
},
"created_at": {
"type": "string"
},
"url": {
"type": "string"
},
"test_url": {
"type": "string"
},
"ping_url": {
"type": "string"
},
"last_response": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"status": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
},
"SendSMSRequestBody": {
"type": "object",
"required": [
"to",
"text"
],
"properties": {
"from": {
"type": "string",
"title": "Sender's phone number",
"x-ms-summary": "Sender's phone number",
"description": "Phone number that will be used as a sender of the outbound text message.",
"x-ms-visibility": "advanced"
},
"to": {
"type": "string",
"title": "Recipient's phone number",
"x-ms-summary": "Recipient's phone number",
"description": "Phone number that the text message will be sent to.",
"x-ms-visibility": "important"
},
"text": {
"type": "string",
"title": "Message",
"x-ms-summary": "Message",
"description": "Text of the message that will be sent.",
"x-ms-visibility": "important"
}
}
},
"SendSMSSuccessResponseBody": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"to": {
"type": "string",
"title": "Destination phone number",
"x-ms-summary": "Destination phone number",
"description": "Cleaned up and standardized phone number that the text message was sent to.",
"x-ms-visibility": "advanced"
},
"messageId": {
"type": "string",
"title": "Unique message id",
"x-ms-summary": "Unique message id",
"description": "Id that uniquely identifies sent text message, can later be used to fetch message log.",
"x-ms-visibility": "internal"
},
"status": {
"type": "object",
"properties": {
"id": {
"type": "number",
"title": "Message sending status id",
"x-ms-summary": "Message sending status id",
"description": "Id of the status of message sending.",
"x-ms-visibility": "advanced"
},
"name": {
"type": "string",
"title": "Message sending status",
"x-ms-summary": "Message sending status",
"description": "Name of the status of message sending.",
"x-ms-visibility": "advanced"
},
"description": {
"type": "string",
"title": "Description of message sending status",
"x-ms-summary": "Description of message sending status",
"description": "Human readable description of the status of message sending.",
"x-ms-visibility": "advanced"
}
}
}
}
}
}
}
},
"BalanceSuccessResponseBody": {
"type": "object",
"properties": {
"balance": {
"type": "number",
"title": "Balance",
"x-ms-summary": "Current account balance",
"description": "Current account balance, expressed in the specified currency.",
"x-ms-visibility": "advanced"
},
"currency": {
"type": "string",
"title": "Currency",
"x-ms-summary": "Currency used to express the balance in",
"description": "Currency used to express the balance in.",
"x-ms-visibility": "advanced"
}
}
},
"FailureResponseBody": {
"type": "object",
"properties": {
"requestError": {
"type": "object",
"properties": {
"serviceException": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"title": "Error id",
"x-ms-summary": "Error id",
"description": "Id of the error that occurred while sending message.",
"x-ms-visibility": "advanced"
},
"text": {
"type": "string",
"title": "Error message",
"x-ms-summary": "Error message",
"description": "Human readable error message that occurred while sending message.",
"x-ms-visibility": "advanced"
}
}
}
}
}
}
},
"VoiceCallRequestBody": {
"type": "object",
"required": [
"to",
"text",
"language"
],
"properties": {
"from": {
"type": "string",
"title": "Caller's phone number",
"x-ms-summary": "Caller's phone number",
"description": "Phone number that will be used as a caller of the outbound voice call.",
"x-ms-visibility": "advanced"
},
"to": {
"type": "string",
"title": "Recipient's phone number",
"x-ms-summary": "Recipient's phone number",
"description": "Phone number that voice call will be made to.",
"x-ms-visibility": "important"
},
"text": {
"type": "string",
"title": "Message",
"x-ms-summary": "Message",
"description": "Text of the message that will be read out loud in the call.",
"x-ms-visibility": "important"
},
"language": {
"type": "string",
"title": "Language",
"x-ms-summary": "Language",
"description": "Language of the call's message.",
"x-ms-visibility": "advanced",
"default": "en",
"enum": [
"en",
"es",
"ca",
"zh-cn",
"zh-tw",
"da",
"nl",
"fr",
"de",
"it",
"ja",
"ko",
"no",
"pl",
"pt-pt",
"pt-br",
"ru",
"sv",
"fi",
"tr"
]
}
}
},
"VoiceCallSuccessResponseBody": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"properties": {
"to": {
"type": "string",
"title": "Destination phone number",
"x-ms-summary": "Destination phone number",
"description": "Cleaned up and standardized phone number that the voice call was made to.",
"x-ms-visibility": "advanced"
},
"messageId": {
"type": "string",
"title": "Unique message id",
"x-ms-summary": "Unique message id",
"description": "Id that uniquely identifies made voice call, can later be used to fetch message log.",
"x-ms-visibility": "internal"
},
"status": {
"type": "object",
"properties": {
"id": {
"type": "number",
"title": "Message sending status id",
"x-ms-summary": "Message sending status id",
"description": "Id of the status of the call.",
"x-ms-visibility": "advanced"
},
"name": {
"type": "string",
"title": "Message sending status",
"x-ms-summary": "Message sending status",
"description": "Name of the status of the call.",
"x-ms-visibility": "advanced"
},
"description": {
"type": "string",
"title": "Description of message sending status",
"x-ms-summary": "Description of message sending status",
"description": "Human readable description of the status of the call.",
"x-ms-visibility": "advanced"
}
}
}
}
}
}
}
}
},
"parameters": {},
"responses": {},
"securityDefinitions": {
"basic_auth": {
"type": "basic"
}
},
"security": [
{
"basic_auth": []
}
],
"tags": [],
"x-ms-capabilities": {
"testConnection": {
"operationId": "CheckCurrentBalance"
}
},
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://www.infobip.com/partnership/integrations/microsoft-flow"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://www.infobip.com/policies/privacy"
},
{
"propertyName": "Categories",
"propertyValue": "Communication;Productivity"
}
]
}