mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 10:34:27 +00:00
41 lines
821 B
Go
Executable File
41 lines
821 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/contact"
|
|
)
|
|
|
|
// Update a contact
|
|
func main() {
|
|
contactService := contact.NewContactService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := contactService.Update(&contact.UpdateRequest{
|
|
Addresses: []contact.Address{
|
|
contact.Address{
|
|
Label: "company address",
|
|
Location: "123 street address",
|
|
}},
|
|
Birthday: "1995-01-01",
|
|
Emails: []contact.Email{
|
|
contact.Email{
|
|
Address: "home@example.com",
|
|
Label: "home",
|
|
}},
|
|
Id: "42e48a3c-6221-11ec-96d2-acde48001122",
|
|
Links: []contact.Link{
|
|
contact.Link{
|
|
Label: "blog",
|
|
Url: "https://blog.joe.me",
|
|
}},
|
|
Name: "joe",
|
|
Note: "this person is very important",
|
|
Phones: []contact.Phone{
|
|
contact.Phone{
|
|
Label: "home",
|
|
Number: "010-12345678",
|
|
}},
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|