Documentation
¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( BaseURL = "https://graph.facebook.com" LowestSupportedAPIVersion = "v20.0" // This is the lowest version of the API that is supported MessageProduct = "whatsapp" )
Variables ¶
This section is empty.
Functions ¶
func IsCorrectAPIVersion ¶
IsCorrectAPIVersion checks if the provided API version string is valid and supported. The version string should be in the format "v<major_version>.<minor_version>". It returns true if the major version is 16 or higher, otherwise false.
Example ¶
package main
import (
"fmt"
"github.com/piusalfred/whatsapp"
)
func main() {
fmt.Println(whatsapp.IsCorrectAPIVersion("v20.1")) // true
fmt.Println(whatsapp.IsCorrectAPIVersion("v21.0")) // true
fmt.Println(whatsapp.IsCorrectAPIVersion("v15.9")) // false
fmt.Println(whatsapp.IsCorrectAPIVersion("v100.0")) // true
fmt.Println(whatsapp.IsCorrectAPIVersion("v0.0")) // false
fmt.Println(whatsapp.IsCorrectAPIVersion("v0.hello")) // false
fmt.Println(whatsapp.IsCorrectAPIVersion("vhi.1")) // false
fmt.Println(whatsapp.IsCorrectAPIVersion("v20.0")) // true
fmt.Println(whatsapp.IsCorrectAPIVersion("20.1")) // false
}
Output: true true false true false false false true false
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
conversation
|
|
|
mocks
|
|
|
auth
Package auth is a generated GoMock package.
|
Package auth is a generated GoMock package. |
|
business
Package business is a generated GoMock package.
|
Package business is a generated GoMock package. |
|
business/analytics
Package analytics is a generated GoMock package.
|
Package analytics is a generated GoMock package. |
|
config
Package config is a generated GoMock package.
|
Package config is a generated GoMock package. |
|
conversation/automation
Package automation is a generated GoMock package.
|
Package automation is a generated GoMock package. |
|
flow
Package flow is a generated GoMock package.
|
Package flow is a generated GoMock package. |
|
http
Package http is a generated GoMock package.
|
Package http is a generated GoMock package. |
|
media
Package media is a generated GoMock package.
|
Package media is a generated GoMock package. |
|
message
Package message is a generated GoMock package.
|
Package message is a generated GoMock package. |
|
phonenumber
Package phonenumber is a generated GoMock package.
|
Package phonenumber is a generated GoMock package. |
|
qrcode
Package qrcode is a generated GoMock package.
|
Package qrcode is a generated GoMock package. |
|
user
Package user is a generated GoMock package.
|
Package user is a generated GoMock package. |
|
webhooks
Package webhooks is a generated GoMock package.
|
Package webhooks is a generated GoMock package. |
|
pkg
|
|
Click to show internal directories.
Click to hide internal directories.