Skip to content

Latest commit

 

History

History
278 lines (174 loc) · 8.22 KB

ContactsAPI.md

File metadata and controls

278 lines (174 loc) · 8.22 KB

\ContactsAPI

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

ContactsCreatePost

ContactSuccessResponse ContactsCreatePost(ctx).ContactRequest(contactRequest).Execute()

Create a contact

Example

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)
}

Path Parameters

Other Parameters

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.

Return type

ContactSuccessResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ContactsDeletePost

ContactDeleteResponse ContactsDeletePost(ctx).ContactDeleteRequest(contactDeleteRequest).Execute()

Delete a contact

Example

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)
}

Path Parameters

Other Parameters

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`.

Return type

ContactDeleteResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ContactsFindGet

[]Contact ContactsFindGet(ctx).Email(email).UserId(userId).Execute()

Find a contact

Example

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)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiContactsFindGetRequest struct via the builder pattern

Name Type Description Notes
email string Email address (URI-encoded)
userId string

Return type

[]Contact

Authorization

apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ContactsUpdatePut

ContactSuccessResponse ContactsUpdatePut(ctx).ContactRequest(contactRequest).Execute()

Update a contact

Example

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)
}

Path Parameters

Other Parameters

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.

Return type

ContactSuccessResponse

Authorization

apiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]