Skip to content

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

Add examples for attachments in swagger doc

Acho Arnold37dd4c00c7be
diff --git a/api/pkg/entities/message.go b/api/pkg/entities/message.go
index b7d423fb..52a9a221 100644
--- a/api/pkg/entities/message.go
+++ b/api/pkg/entities/message.go
@@ -90,7 +90,7 @@ type Message struct {
UserID UserID `json:"user_id" gorm:"index:idx_messages__user_id" example:"WB7DRDWrJZRGbYrv2CKGkqbzvqdC"`
Contact string `json:"contact" example:"+18005550100"`
Content string `json:"content" example:"This is a sample text message"`
- Attachments pq.StringArray `json:"attachments" gorm:"type:text[]" swaggertype:"array,string"`
+ Attachments pq.StringArray `json:"attachments" gorm:"type:text[]" swaggertype:"array,string" example:"https://example.com/image.jpg,https://example.com/video.mp4"`
Encrypted bool `json:"encrypted" example:"false" gorm:"default:false"`
Type MessageType `json:"type" example:"mobile-terminated"`
Status MessageStatus `json:"status" example:"pending"`
diff --git a/api/pkg/requests/message_send_request.go b/api/pkg/requests/message_send_request.go
index bebf6f48..727cc12e 100644
--- a/api/pkg/requests/message_send_request.go
+++ b/api/pkg/requests/message_send_request.go
@@ -19,7 +19,7 @@ type MessageSend struct {
Content string `json:"content" example:"This is a sample text message"`
// Attachments are optional. When you provide a list of attachments, the message will be sent out as an MMS
- Attachments []string `json:"attachments" validate:"optional"`
+ Attachments []string `json:"attachments" validate:"optional" example:"https://example.com/image.jpg,https://example.com/video.mp4"`
// Encrypted is an optional parameter used to determine if the content is end-to-end encrypted. Make sure to set the encryption key on the httpSMS mobile app
Encrypted bool `json:"encrypted" example:"false" validate:"optional"`