GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NdoleStudio/httpsms-go: Go Client for the httpSMS API https://api.httpsms.com

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
internal
internal
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
cipher_service.go
cipher_service.go
 
 
cipher_service_test.go
cipher_service_test.go
 
 
client.go
client.go
 
 
client_config.go
client_config.go
 
 
client_option.go
client_option.go
 
 
client_option_test.go
client_option_test.go
 
 
contracts.go
contracts.go
 
 
event_types.go
event_types.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
heartbeat.go
heartbeat.go
 
 
heartbeat_service.go
heartbeat_service.go
 
 
heartbeat_service_test.go
heartbeat_service_test.go
 
 
message.go
message.go
 
 
message_service.go
message_service.go
 
 
message_service_test.go
message_service_test.go
 
 
message_thread.go
message_thread.go
 
 
message_thread_service.go
message_thread_service.go
 
 
message_thread_service_test.go
message_thread_service_test.go
 
 
phone.go
phone.go
 
 
phone_api_key.go
phone_api_key.go
 
 
phone_api_key_service.go
phone_api_key_service.go
 
 
phone_api_key_service_test.go
phone_api_key_service_test.go
 
 
phone_service.go
phone_service.go
 
 
phone_service_test.go
phone_service_test.go
 
 
response.go
response.go
 
 
webhook.go
webhook.go
 
 
webhook_service.go
webhook_service.go
 
 
webhook_service_test.go
webhook_service_test.go
 
 

Repository files navigation

httpsms-go

Build codecov Scrutinizer Code Quality Go Report Card GitHub contributors GitHub license PkgGoDev

This package provides a generic go client template for the Http SMS Api

Installation

httpsms-go is compatible with modern Go releases in module mode, with Go installed:

go get github.com/NdoleStudio/httpsms-go

Alternatively the same can be achieved if you use import in a package:

import "github.com/NdoleStudio/httpsms-go"

Implemented

  • Messages
    • POST /v1/messages/send: Send a new SMS
    • GET /v1/messages: Get list of messages which are exchanged between 2 phone numbers.
  • Heartbeats
    • GET /v1/heartbeats: Get the heartbeats of an Android Phone
  • Message Threads
    • GET /v1/message-threads: Get the message threads of a phone number
    • DELETE v1/message-threads/:messageThreadID: Delete a message thread
  • Cipher
    • Encrypt: Encrypt the content of a message to cipher text
    • Decrypt: Decrypt an encrypted message content to plain text
  • Phones
    • PUT /v1/phones: Create or update a phone
    • PUT /v1/phones/fcm-token: Bind an FCM token to a phone
  • Phone API Keys
    • POST /v1/phone-api-keys/: Create a new phone API key
  • Webhooks
    • POST /v1/webhooks: Create a new webhook

Usage

Initializing the Client

An instance of the client can be created using httpsms.New().

package main

import (
    "github.com/NdoleStudio/httpsms-go"
)

func main()  {
    client := htpsms.New(htpsms.WithAPIKey(/* API Key from https://httpsms.com/settings */))
}

Error handling

All API calls return an error as the last return object. All successful calls will return a nil error.

_, response, err := client.Messages.Send(context.Background())
if err != nil {
    //handle error
}

Messages

POST /v1/messages/send: Send a new SMS Message

message, response, err := client.Messages.Send(context.Background(), &MessageSendParams{
    Content: "This is a sample text message",
    From:    "+18005550199",
    To:      "+18005550100",
})

if err != nil {
    log.Fatal(err)
}

log.Println(message.Code) // 202

Testing

You can run the unit tests for this client from the root directory using the command below:

go test -v

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Go Client for the httpSMS API https://api.httpsms.com

docs.httpsms.com

Topics

httpsmshttpsms-apihttpsms-gosmssms-gateway

Resources

Readme
MIT license
Activity
Custom properties

Stars

21 stars

Watchers

2 watching

Forks

11 forks
Report repository

Releases

Used by

Contributors

Languages

Generated from NdoleStudio/go-http-client
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.