-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
34 lines (27 loc) · 910 Bytes
/
main.go
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
33
34
package main
import (
"encoding/xml"
"github.com/felipechang/suiteauth-go/auth"
"log"
)
func main() {
p := auth.NewHeader(&auth.HeaderOptions{
AccountId: "1234567-sb1",
ConsumerKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
ConsumerSecret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
TokenId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
TokenSecret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
})
soapUri := p.GetSoapApiBaseUri("2021_1")
soapHeader := p.GetSoapApiAuthHeader("2021_1")
output, err := xml.MarshalIndent(soapHeader, " ", " ")
if err != nil {
log.Fatalln(err)
}
log.Printf("auth soapUri: %s", soapUri)
log.Printf("auth soapHeader: %s", string(output))
restUri := p.GetRestApiBaseUri()
restHeader := p.GetRestApiAuthHeader("GET", restUri)
log.Printf("auth restUri: %s", restUri)
log.Printf("auth restHeader: %s", restHeader)
}