Skip to content

Latest commit

 

History

History
849 lines (543 loc) · 31.9 KB

ContactsApi.md

File metadata and controls

849 lines (543 loc) · 31.9 KB

\ContactsApi

All URIs are relative to https://api.sendinblue.com/v3

Method HTTP request Description
AddContactToList Post /contacts/lists/{listId}/contacts/add Add existing contacts to a list
CreateAttribute Post /contacts/attributes/{attributeCategory}/{attributeName} Create contact attribute
CreateContact Post /contacts Create a contact
CreateDoiContact Post /contacts/doubleOptinConfirmation Create Contact via DOI (Double-Opt-In) Flow
CreateFolder Post /contacts/folders Create a folder
CreateList Post /contacts/lists Create a list
DeleteAttribute Delete /contacts/attributes/{attributeCategory}/{attributeName} Delete an attribute
DeleteContact Delete /contacts/{identifier} Delete a contact
DeleteFolder Delete /contacts/folders/{folderId} Delete a folder (and all its lists)
DeleteList Delete /contacts/lists/{listId} Delete a list
GetAttributes Get /contacts/attributes List all attributes
GetContactInfo Get /contacts/{identifier} Get a contact's details
GetContactStats Get /contacts/{identifier}/campaignStats Get email campaigns' statistics for a contact
GetContacts Get /contacts Get all the contacts
GetContactsFromList Get /contacts/lists/{listId}/contacts Get contacts in a list
GetFolder Get /contacts/folders/{folderId} Returns a folder's details
GetFolderLists Get /contacts/folders/{folderId}/lists Get lists in a folder
GetFolders Get /contacts/folders Get all folders
GetList Get /contacts/lists/{listId} Get a list's details
GetLists Get /contacts/lists Get all the lists
ImportContacts Post /contacts/import Import contacts
RemoveContactFromList Post /contacts/lists/{listId}/contacts/remove Delete a contact from a list
RequestContactExport Post /contacts/export Export contacts
UpdateAttribute Put /contacts/attributes/{attributeCategory}/{attributeName} Update contact attribute
UpdateBatchContacts Post /contacts/batch Update multiple contacts
UpdateContact Put /contacts/{identifier} Update a contact
UpdateFolder Put /contacts/folders/{folderId} Update a folder
UpdateList Put /contacts/lists/{listId} Update a list

AddContactToList

PostContactInfo AddContactToList(ctx, listId, contactEmails) Add existing contacts to a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list
contactEmails AddContactToList Emails addresses OR IDs of the contacts

Return type

PostContactInfo

Authorization

api-key, partner-key

HTTP request headers

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

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

CreateAttribute

CreateAttribute(ctx, attributeCategory, attributeName, createAttribute) Create contact attribute

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attributeCategory string Category of the attribute
attributeName string Name of the attribute
createAttribute CreateAttribute Values to create an attribute

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

CreateContact

CreateUpdateContactModel CreateContact(ctx, createContact) Create a contact

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
createContact CreateContact Values to create a contact

Return type

CreateUpdateContactModel

Authorization

api-key, partner-key

HTTP request headers

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

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

CreateDoiContact

CreateDoiContact(ctx, createDoiContact) Create Contact via DOI (Double-Opt-In) Flow

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
createDoiContact CreateDoiContact Values to create the Double opt-in (DOI) contact

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

CreateFolder

CreateModel CreateFolder(ctx, createFolder) Create a folder

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
createFolder CreateUpdateFolder Name of the folder

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

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

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

CreateList

CreateModel CreateList(ctx, createList) Create a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
createList CreateList Values to create a list

Return type

CreateModel

Authorization

api-key, partner-key

HTTP request headers

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

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

DeleteAttribute

DeleteAttribute(ctx, attributeCategory, attributeName) Delete an attribute

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attributeCategory string Category of the attribute
attributeName string Name of the existing attribute

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

DeleteContact

DeleteContact(ctx, identifier) Delete a contact

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
identifier string Email (urlencoded) OR ID of the contact

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

DeleteFolder

DeleteFolder(ctx, folderId) Delete a folder (and all its lists)

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
folderId int64 Id of the folder

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

DeleteList

DeleteList(ctx, listId) Delete a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

GetAttributes

GetAttributes GetAttributes(ctx, ) List all attributes

Required Parameters

This endpoint does not need any parameter.

Return type

GetAttributes

Authorization

api-key, partner-key

HTTP request headers

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

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

GetContactInfo

GetExtendedContactDetails GetContactInfo(ctx, identifier, optional) Get a contact's details

Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats (https://developers.sendinblue.com/reference/contacts-7#getcontactstats) endpoint with the appropriate date ranges.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
identifier string Email (urlencoded) OR ID of the contact OR its SMS attribute value
optional *GetContactInfoOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetContactInfoOpts struct

Name Type Description Notes

startDate | optional.Interface of interface{}| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | endDate | optional.Interface of interface{}| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. |

Return type

GetExtendedContactDetails

Authorization

api-key, partner-key

HTTP request headers

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

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

GetContactStats

GetContactCampaignStats GetContactStats(ctx, identifier, optional) Get email campaigns' statistics for a contact

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
identifier string Email (urlencoded) OR ID of the contact
optional *GetContactStatsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetContactStatsOpts struct

Name Type Description Notes

startDate | optional.String| Mandatory if endDate is used. Starting date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be lower than equal to endDate | endDate | optional.String| Mandatory if startDate is used. Ending date (YYYY-MM-DD) of the statistic events specific to campaigns. Must be greater than equal to startDate. Maximum difference between startDate and endDate should not be greater than 90 days |

Return type

GetContactCampaignStats

Authorization

api-key, partner-key

HTTP request headers

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

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

GetContacts

GetContacts GetContacts(ctx, optional) Get all the contacts

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *GetContactsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetContactsOpts struct

Name Type Description Notes
limit optional.Int64 Number of documents per page [default to 50]
offset optional.Int64 Index of the first document of the page [default to 0]
modifiedSince optional.String Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
sort optional.String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [default to desc]

Return type

GetContacts

Authorization

api-key, partner-key

HTTP request headers

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

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

GetContactsFromList

GetContacts GetContactsFromList(ctx, listId, optional) Get contacts in a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list
optional *GetContactsFromListOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetContactsFromListOpts struct

Name Type Description Notes

modifiedSince | optional.String| Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. | limit | optional.Int64| Number of documents per page | [default to 50] offset | optional.Int64| Index of the first document of the page | [default to 0] sort | optional.String| Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [default to desc]

Return type

GetContacts

Authorization

api-key, partner-key

HTTP request headers

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

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

GetFolder

GetFolder GetFolder(ctx, folderId) Returns a folder's details

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
folderId int64 id of the folder

Return type

GetFolder

Authorization

api-key, partner-key

HTTP request headers

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

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

GetFolderLists

GetFolderLists GetFolderLists(ctx, folderId, optional) Get lists in a folder

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
folderId int64 Id of the folder
optional *GetFolderListsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetFolderListsOpts struct

Name Type Description Notes

limit | optional.Int64| Number of documents per page | [default to 10] offset | optional.Int64| Index of the first document of the page | [default to 0] sort | optional.String| Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [default to desc]

Return type

GetFolderLists

Authorization

api-key, partner-key

HTTP request headers

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

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

GetFolders

GetFolders GetFolders(ctx, limit, offset, optional) Get all folders

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
limit int64 Number of documents per page [default to 10]
offset int64 Index of the first document of the page [default to 0]
optional *GetFoldersOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetFoldersOpts struct

Name Type Description Notes

sort | optional.String| Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed | [default to desc]

Return type

GetFolders

Authorization

api-key, partner-key

HTTP request headers

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

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

GetList

GetExtendedList GetList(ctx, listId) Get a list's details

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list

Return type

GetExtendedList

Authorization

api-key, partner-key

HTTP request headers

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

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

GetLists

GetLists GetLists(ctx, optional) Get all the lists

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *GetListsOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a GetListsOpts struct

Name Type Description Notes
limit optional.Int64 Number of documents per page [default to 10]
offset optional.Int64 Index of the first document of the page [default to 0]
sort optional.String Sort the results in the ascending/descending order of record creation. Default order is descending if `sort` is not passed [default to desc]

Return type

GetLists

Authorization

api-key, partner-key

HTTP request headers

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

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

ImportContacts

CreatedProcessId ImportContacts(ctx, requestContactImport) Import contacts

It returns the background process ID which on completion calls the notify URL that you have set in the input.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
requestContactImport RequestContactImport Values to import contacts in Sendinblue. To know more about the expected format, please have a look at ``https://help.sendinblue.com/hc/en-us/articles/209499265-Build-contacts-lists-for-your-email-marketing-campaigns``

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

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

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

RemoveContactFromList

PostContactInfo RemoveContactFromList(ctx, listId, contactEmails) Delete a contact from a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list
contactEmails RemoveContactFromList Emails addresses OR IDs of the contacts

Return type

PostContactInfo

Authorization

api-key, partner-key

HTTP request headers

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

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

RequestContactExport

CreatedProcessId RequestContactExport(ctx, requestContactExport) Export contacts

It returns the background process ID which on completion calls the notify URL that you have set in the input. File will be available in csv.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
requestContactExport RequestContactExport Values to request a contact export

Return type

CreatedProcessId

Authorization

api-key, partner-key

HTTP request headers

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

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

UpdateAttribute

UpdateAttribute(ctx, attributeCategory, attributeName, updateAttribute) Update contact attribute

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
attributeCategory string Category of the attribute
attributeName string Name of the existing attribute
updateAttribute UpdateAttribute Values to update an attribute

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

UpdateBatchContacts

UpdateBatchContacts(ctx, updateBatchContacts) Update multiple contacts

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
updateBatchContacts UpdateBatchContacts Values to update multiple contacts

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

UpdateContact

UpdateContact(ctx, identifier, updateContact) Update a contact

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
identifier string Email (urlencoded) OR ID of the contact
updateContact UpdateContact Values to update a contact

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

UpdateFolder

UpdateFolder(ctx, folderId, updateFolder) Update a folder

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
folderId int64 Id of the folder
updateFolder CreateUpdateFolder Name of the folder

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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

UpdateList

UpdateList(ctx, listId, updateList) Update a list

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
listId int64 Id of the list
updateList UpdateList Values to update a list

Return type

(empty response body)

Authorization

api-key, partner-key

HTTP request headers

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

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