All URIs are relative to https://app.loops.so/api/v1
Method | HTTP request | Description |
---|---|---|
ContactsCreatePost | Post /contacts/create | Create a contact |
ContactsDeletePost | Post /contacts/delete | Delete a contact |
ContactsFindGet | Get /contacts/find | Find a contact |
ContactsUpdatePut | Put /contacts/update | Update a contact |
ContactSuccessResponse ContactsCreatePost(ctx).ContactRequest(contactRequest).Execute()
Create a contact
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/behnh/loops-api-go"
)
func main() {
contactRequest := *openapiclient.NewContactRequest("Email_example") // ContactRequest | You can add custom contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates))).<br>Make sure to create the properties in Loops before using them in API calls.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ContactsAPI.ContactsCreatePost(context.Background()).ContactRequest(contactRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ContactsAPI.ContactsCreatePost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ContactsCreatePost`: ContactSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `ContactsAPI.ContactsCreatePost`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiContactsCreatePostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
contactRequest | ContactRequest | You can add custom contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` (see available date formats)).<br>Make sure to create the properties in Loops before using them in API calls. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactDeleteResponse ContactsDeletePost(ctx).ContactDeleteRequest(contactDeleteRequest).Execute()
Delete a contact
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/behnh/loops-api-go"
)
func main() {
contactDeleteRequest := *openapiclient.NewContactDeleteRequest("Email_example", "UserId_example") // ContactDeleteRequest | Include only one of `email` or `userId`.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ContactsAPI.ContactsDeletePost(context.Background()).ContactDeleteRequest(contactDeleteRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ContactsAPI.ContactsDeletePost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ContactsDeletePost`: ContactDeleteResponse
fmt.Fprintf(os.Stdout, "Response from `ContactsAPI.ContactsDeletePost`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiContactsDeletePostRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
contactDeleteRequest | ContactDeleteRequest | Include only one of `email` or `userId`. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Contact ContactsFindGet(ctx).Email(email).UserId(userId).Execute()
Find a contact
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/behnh/loops-api-go"
)
func main() {
email := "email_example" // string | Email address (URI-encoded) (optional)
userId := "userId_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ContactsAPI.ContactsFindGet(context.Background()).Email(email).UserId(userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ContactsAPI.ContactsFindGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ContactsFindGet`: []Contact
fmt.Fprintf(os.Stdout, "Response from `ContactsAPI.ContactsFindGet`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiContactsFindGetRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
string | Email address (URI-encoded) | ||
userId | string |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ContactSuccessResponse ContactsUpdatePut(ctx).ContactRequest(contactRequest).Execute()
Update a contact
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/behnh/loops-api-go"
)
func main() {
contactRequest := *openapiclient.NewContactRequest("Email_example") // ContactRequest | You can add custom contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates))).<br>Make sure to create the properties in Loops before using them in API calls.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ContactsAPI.ContactsUpdatePut(context.Background()).ContactRequest(contactRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ContactsAPI.ContactsUpdatePut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ContactsUpdatePut`: ContactSuccessResponse
fmt.Fprintf(os.Stdout, "Response from `ContactsAPI.ContactsUpdatePut`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiContactsUpdatePutRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
contactRequest | ContactRequest | You can add custom contact properties as keys in this request (of type `string`, `number`, `boolean` or `date` (see available date formats)).<br>Make sure to create the properties in Loops before using them in API calls. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]