-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
32 lines (27 loc) · 716 Bytes
/
main.go
File metadata and controls
32 lines (27 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"fmt"
"log"
greenapi "github.com/green-api/max-api-client-golang"
)
func main() {
GreenAPI := greenapi.GreenAPI{
APIURL: "https://api.green-api.com/v3",
MediaURL: "https://api.green-api.com/v3",
IDInstance: "3100000001",
APITokenInstance: "d75b3a66374942c5b3c019c698abc2067e151558acbd412345",
}
response, err := GreenAPI.Sending().SendFileByUrl(
"10000000",
"urlFile",
"fileName",
greenapi.OptionalCaptionSendUrl("Caption"),
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("Status: %v %s \n\rResponse: %s\n\rTimestamp: %s\n\r", response.StatusCode,
response.StatusMessage,
response.Body,
response.Timestamp.Format("15:04:05.000"))
}