Skip to content

Send and receive SMS messages using your Android phone programmatically via a simple HTTP API

Generate docs

Acho Arnoldfd2cddd6a95a
diff --git a/api/docs/docs.go b/api/docs/docs.go
index 018614fa..5adf69c3 100644
--- a/api/docs/docs.go
+++ b/api/docs/docs.go
@@ -2191,17 +2191,14 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Send Schedules"
+ "SendSchedules"
],
"summary": "List send schedules",
"responses": {
"200": {
"description": "OK",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/entities.MessageSendSchedule"
- }
+ "$ref": "#/definitions/responses.MessageSendSchedulesResponse"
}
},
"401": {
@@ -2232,7 +2229,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Send Schedules"
+ "SendSchedules"
],
"summary": "Create send schedule",
"parameters": [
@@ -2268,7 +2265,7 @@ const docTemplate = `{
"402": {
"description": "Payment Required",
"schema": {
- "$ref": "#/definitions/responses.BadRequest"
+ "$ref": "#/definitions/responses.PaymentRequired"
}
},
"422": {
@@ -2301,7 +2298,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Send Schedules"
+ "SendSchedules"
],
"summary": "Update send schedule",
"parameters": [
@@ -2372,7 +2369,7 @@ const docTemplate = `{
"application/json"
],
"tags": [
- "Send Schedules"
+ "SendSchedules"
],
"summary": "Delete send schedule",
"parameters": [
@@ -3529,7 +3526,6 @@ const docTemplate = `{
"required": [
"created_at",
"id",
- "is_active",
"name",
"timezone",
"updated_at",
@@ -3545,10 +3541,6 @@ const docTemplate = `{
"type": "string",
"example": "32343a19-da5e-4b1b-a767-3298a73703cb"
},
- "is_active": {
- "type": "boolean",
- "example": true
- },
"name": {
"type": "string",
"example": "Business Hours"
@@ -3669,9 +3661,9 @@ const docTemplate = `{
"id",
"max_send_attempts",
"message_expiration_seconds",
+ "message_send_schedule_id",
"messages_per_minute",
"phone_number",
- "schedule_id",
"sim",
"updated_at",
"user_id"
@@ -3698,6 +3690,10 @@ const docTemplate = `{
"description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",
"type": "integer"
},
+ "message_send_schedule_id": {
+ "type": "string",
+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
+ },
"messages_per_minute": {
"type": "integer",
"example": 1
@@ -3710,10 +3706,6 @@ const docTemplate = `{
"type": "string",
"example": "+18005550199"
},
- "schedule_id": {
- "type": "string",
- "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
- },
"sim": {
"$ref": "#/definitions/entities.SIM"
},
@@ -4255,15 +4247,11 @@ const docTemplate = `{
"requests.MessageSendScheduleStore": {
"type": "object",
"required": [
- "is_active",
"name",
"timezone",
"windows"
],
"properties": {
- "is_active": {
- "type": "boolean"
- },
"name": {
"type": "string"
},
@@ -4353,7 +4341,6 @@ const docTemplate = `{
"messages_per_minute",
"missed_call_auto_reply",
"phone_number",
- "schedule_id",
"sim"
],
"properties": {
@@ -4371,6 +4358,10 @@ const docTemplate = `{
"type": "integer",
"example": 12345
},
+ "message_send_schedule_id": {
+ "type": "string",
+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
+ },
"messages_per_minute": {
"type": "integer",
"example": 1
@@ -4383,10 +4374,6 @@ const docTemplate = `{
"type": "string",
"example": "+18005550199"
},
- "schedule_id": {
- "type": "string",
- "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
- },
"sim": {
"description": "SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot",
"type": "string",
@@ -4762,6 +4749,30 @@ const docTemplate = `{
}
}
},
+ "responses.MessageSendSchedulesResponse": {
+ "type": "object",
+ "required": [
+ "data",
+ "message",
+ "status"
+ ],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/entities.MessageSendSchedule"
+ }
+ },
+ "message": {
+ "type": "string",
+ "example": "Request handled successfully"
+ },
+ "status": {
+ "type": "string",
+ "example": "success"
+ }
+ }
+ },
"responses.MessageThreadsResponse": {
"type": "object",
"required": [
@@ -4865,6 +4876,23 @@ const docTemplate = `{
}
}
},
+ "responses.PaymentRequired": {
+ "type": "object",
+ "required": [
+ "message",
+ "status"
+ ],
+ "properties": {
+ "message": {
+ "type": "string",
+ "example": "You have reached the maximum number of allowed resources. Please upgrade your plan."
+ },
+ "status": {
+ "type": "string",
+ "example": "error"
+ }
+ }
+ },
"responses.PhoneAPIKeyResponse": {
"type": "object",
"required": [
diff --git a/api/docs/swagger.json b/api/docs/swagger.json
index 3045ce7f..4a9de5a7 100644
--- a/api/docs/swagger.json
+++ b/api/docs/swagger.json
@@ -1991,16 +1991,13 @@
],
"description": "List all send schedules owned by the authenticated user.",
"produces": ["application/json"],
- "tags": ["Send Schedules"],
+ "tags": ["SendSchedules"],
"summary": "List send schedules",
"responses": {
"200": {
"description": "OK",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/entities.MessageSendSchedule"
- }
+ "$ref": "#/definitions/responses.MessageSendSchedulesResponse"
}
},
"401": {
@@ -2026,7 +2023,7 @@
"description": "Create a new send schedule for the authenticated user.",
"consumes": ["application/json"],
"produces": ["application/json"],
- "tags": ["Send Schedules"],
+ "tags": ["SendSchedules"],
"summary": "Create send schedule",
"parameters": [
{
@@ -2061,7 +2058,7 @@
"402": {
"description": "Payment Required",
"schema": {
- "$ref": "#/definitions/responses.BadRequest"
+ "$ref": "#/definitions/responses.PaymentRequired"
}
},
"422": {
@@ -2089,7 +2086,7 @@
"description": "Update a send schedule owned by the authenticated user.",
"consumes": ["application/json"],
"produces": ["application/json"],
- "tags": ["Send Schedules"],
+ "tags": ["SendSchedules"],
"summary": "Update send schedule",
"parameters": [
{
@@ -2156,7 +2153,7 @@
],
"description": "Delete a send schedule owned by the authenticated user.",
"produces": ["application/json"],
- "tags": ["Send Schedules"],
+ "tags": ["SendSchedules"],
"summary": "Delete send schedule",
"parameters": [
{
@@ -3234,7 +3231,6 @@
"required": [
"created_at",
"id",
- "is_active",
"name",
"timezone",
"updated_at",
@@ -3250,10 +3246,6 @@
"type": "string",
"example": "32343a19-da5e-4b1b-a767-3298a73703cb"
},
- "is_active": {
- "type": "boolean",
- "example": true
- },
"name": {
"type": "string",
"example": "Business Hours"
@@ -3370,9 +3362,9 @@
"id",
"max_send_attempts",
"message_expiration_seconds",
+ "message_send_schedule_id",
"messages_per_minute",
"phone_number",
- "schedule_id",
"sim",
"updated_at",
"user_id"
@@ -3399,6 +3391,10 @@
"description": "MessageExpirationSeconds is the duration in seconds after sending a message when it is considered to be expired.",
"type": "integer"
},
+ "message_send_schedule_id": {
+ "type": "string",
+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
+ },
"messages_per_minute": {
"type": "integer",
"example": 1
@@ -3411,10 +3407,6 @@
"type": "string",
"example": "+18005550199"
},
- "schedule_id": {
- "type": "string",
- "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
- },
"sim": {
"$ref": "#/definitions/entities.SIM"
},
@@ -3899,11 +3891,8 @@
},
"requests.MessageSendScheduleStore": {
"type": "object",
- "required": ["is_active", "name", "timezone", "windows"],
+ "required": ["name", "timezone", "windows"],
"properties": {
- "is_active": {
- "type": "boolean"
- },
"name": {
"type": "string"
},
@@ -3981,7 +3970,6 @@
"messages_per_minute",
"missed_call_auto_reply",
"phone_number",
- "schedule_id",
"sim"
],
"properties": {
@@ -3999,6 +3987,10 @@
"type": "integer",
"example": 12345
},
+ "message_send_schedule_id": {
+ "type": "string",
+ "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
+ },
"messages_per_minute": {
"type": "integer",
"example": 1
@@ -4011,10 +4003,6 @@
"type": "string",
"example": "+18005550199"
},
- "schedule_id": {
- "type": "string",
- "example": "32343a19-da5e-4b1b-a767-3298a73703cb"
- },
"sim": {
"description": "SIM is the SIM slot of the phone in case the phone has more than 1 SIM slot",
"type": "string",
@@ -4332,6 +4320,26 @@
}
}
},
+ "responses.MessageSendSchedulesResponse": {
+ "type": "object",
+ "required": ["data", "message", "status"],
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/entities.MessageSendSchedule"
+ }
+ },
+ "message": {
+ "type": "string",
+ "example": "Request handled successfully"
+ },
+ "status": {
+ "type": "string",
+ "example": "success"
+ }
+ }
+ },
"responses.MessageThreadsResponse": {
"type": "object",
"required": ["data", "message", "status"],
@@ -4417,6 +4425,20 @@
}
}
},
+ "responses.PaymentRequired": {
+ "type": "object",
+ "required": ["message", "status"],
+ "properties": {
+ "message": {
+ "type": "string",
+ "example": "You have reached the maximum number of allowed resources. Please upgrade your plan."
+ },
+ "status": {
+ "type": "string",
+ "example": "error"
+ }
+ }
+ },
"responses.PhoneAPIKeyResponse": {
"type": "object",
"required": ["data", "message", "status"],
diff --git a/api/docs/swagger.yaml b/api/docs/swagger.yaml
index 58cee295..ff50acaa 100644
--- a/api/docs/swagger.yaml
+++ b/api/docs/swagger.yaml
@@ -222,9 +222,6 @@ definitions:
id:
example: 32343a19-da5e-4b1b-a767-3298a73703cb
type: string
- is_active:
- example: true
- type: boolean
name:
example: Business Hours
type: string
@@ -244,7 +241,6 @@ definitions:
required:
- created_at
- id
- - is_active
- name
- timezone
- updated_at
@@ -341,6 +337,9 @@ definitions:
MessageExpirationSeconds is the duration in seconds after sending
a message when it is considered to be expired.
type: integer
+ message_send_schedule_id:
+ example: 32343a19-da5e-4b1b-a767-3298a73703cb
+ type: string
messages_per_minute:
example: 1
type: integer
@@ -350,9 +349,6 @@ definitions:
phone_number:
example: "+18005550199"
type: string
- schedule_id:
- example: 32343a19-da5e-4b1b-a767-3298a73703cb
- type: string
sim:
$ref: "#/definitions/entities.SIM"
updated_at:
@@ -366,9 +362,9 @@ definitions:
- id
- max_send_attempts
- message_expiration_seconds
+ - message_send_schedule_id
- messages_per_minute
- phone_number
- - schedule_id
- sim
- updated_at
- user_id
@@ -795,8 +791,6 @@ definitions:
type: object
requests.MessageSendScheduleStore:
properties:
- is_active:
- type: boolean
name:
type: string
timezone:
@@ -806,7 +800,6 @@ definitions:
$ref: "#/definitions/requests.MessageSendScheduleWindow"
type: array
required:
- - is_active
- name
- timezone
- windows
@@ -876,6 +869,9 @@ definitions:
a message when it is considered to be expired.
example: 12345
type: integer
+ message_send_schedule_id:
+ example: 32343a19-da5e-4b1b-a767-3298a73703cb
+ type: string
messages_per_minute:
example: 1
type: integer
@@ -885,9 +881,6 @@ definitions:
phone_number:
example: "+18005550199"
type: string
- schedule_id:
- example: 32343a19-da5e-4b1b-a767-3298a73703cb
- type: string
sim:
description:
SIM is the SIM slot of the phone in case the phone has more than
@@ -901,7 +894,6 @@ definitions:
- messages_per_minute
- missed_call_auto_reply
- phone_number
- - schedule_id
- sim
type: object
requests.UserNotificationUpdate:
@@ -1168,6 +1160,23 @@ definitions:
- message
- status
type: object
+ responses.MessageSendSchedulesResponse:
+ properties:
+ data:
+ items:
+ $ref: "#/definitions/entities.MessageSendSchedule"
+ type: array
+ message:
+ example: Request handled successfully
+ type: string
+ status:
+ example: success
+ type: string
+ required:
+ - data
+ - message
+ - status
+ type: object
responses.MessageThreadsResponse:
properties:
data:
@@ -1241,6 +1250,20 @@ definitions:
- message
- status
type: object
+ responses.PaymentRequired:
+ properties:
+ message:
+ example:
+ You have reached the maximum number of allowed resources. Please
+ upgrade your plan.
+ type: string
+ status:
+ example: error
+ type: string
+ required:
+ - message
+ - status
+ type: object
responses.PhoneAPIKeyResponse:
properties:
data:
@@ -2958,9 +2981,7 @@ paths:
"200":
description: OK
schema:
- items:
- $ref: "#/definitions/entities.MessageSendSchedule"
- type: array
+ $ref: "#/definitions/responses.MessageSendSchedulesResponse"
"401":
description: Unauthorized
schema:
@@ -2973,7 +2994,7 @@ paths:
- ApiKeyAuth: []
summary: List send schedules
tags:
- - Send Schedules
+ - SendSchedules
post:
consumes:
- application/json
@@ -3003,7 +3024,7 @@ paths:
"402":
description: Payment Required
schema:
- $ref: "#/definitions/responses.BadRequest"
+ $ref: "#/definitions/responses.PaymentRequired"
"422":
description: Unprocessable Entity
schema:
@@ -3016,7 +3037,7 @@ paths:
- ApiKeyAuth: []
summary: Create send schedule
tags:
- - Send Schedules
+ - SendSchedules
/send-schedules/{scheduleID}:
delete:
description: Delete a send schedule owned by the authenticated user.
@@ -3051,7 +3072,7 @@ paths:
- ApiKeyAuth: []
summary: Delete send schedule
tags:
- - Send Schedules
+ - SendSchedules
put:
consumes:
- application/json
@@ -3099,7 +3120,7 @@ paths:
- ApiKeyAuth: []
summary: Update send schedule
tags:
- - Send Schedules
+ - SendSchedules
/users/{userID}/api-keys:
delete:
consumes: