Categorygithub.com/ycloud-developers/ycloud-sdk-go
repositorypackage
1.15.2
Repository: https://github.com/ycloud-developers/ycloud-sdk-go.git
Documentation: pkg.go.dev

# README

YCloud SDK for Go

The YCloud API is organized around REST. Our API is designed to have predictable, resource-oriented URLs, return JSON responses, and use standard HTTP response codes and verbs.

Overview

  • API version: v2
  • Package version: 1.15.2

Installation

Install the following dependencies:

go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/ycloud-developers/ycloud-sdk-go

Add the following in import:

import ycloud "github.com/ycloud-developers/ycloud-sdk-go"

Documentation for API Endpoints

All URIs are relative to https://api.ycloud.com/v2

ClassMethodHTTP requestDescription
BalanceApiRetrieveGet /balanceRetrieve balance
ContactsApiCreatePost /contact/contactsCreate a contact
ContactsApiDeleteDelete /contact/contacts/{id}Delete a contact
ContactsApiListGet /contact/contactsList contacts
ContactsApiRetrieveGet /contact/contacts/{id}Retrieve a contact
ContactsApiUpdatePatch /contact/contacts/{id}Update a contact
CustomEventsApiCreateDefinitionPost /event/definitionsCreate an event definition
CustomEventsApiCreatePropertyDefinitionPost /event/definitions/{name}/propertiesCreate an event property definition
CustomEventsApiPropertyDefinitionDelete /event/definitions/{name}/properties/{propertyName}Delete an event property definition
CustomEventsApiPropertyDefinition_0Patch /event/definitions/{name}/properties/{propertyName}Update an event property definition
CustomEventsApiRetrieveDefinitionGet /event/definitions/{name}Retrieve an event definition
CustomEventsApiSendEventPost /event/eventsSend an event
CustomEventsApiUpdateDefinitionPatch /event/definitions/{name}Update an event definition
EmailsApiSendPost /emailsSend an email
SmsApiListGet /smsList SMS records
SmsApiSendPost /smsSend an SMS
UnsubscribersApiCreatePost /unsubscribersCreate an unsubscriber
UnsubscribersApiDeleteByCustomerAndChannelDelete /unsubscribers/{customer}/{channel}Delete an unsubscriber
UnsubscribersApiListGet /unsubscribersList unsubscribers
UnsubscribersApiListAllByCustomerGet /unsubscribers/{customer}List all unsubscribers by customer
UnsubscribersApiRetrieveByCustomerAndChannelGet /unsubscribers/{customer}/{channel}Retrieve an unsubscriber
VerifyApiCheckPost /verify/verificationChecksCheck a verification
VerifyApiSendPost /verify/verificationsStart a verification
VoicesApiListGet /voicesList voice records
VoicesApiSendPost /voicesSend a voice code
WebhookEndpointsApiCreatePost /webhookEndpointsCreate a webhook endpoint
WebhookEndpointsApiDeleteDelete /webhookEndpoints/{id}Delete a webhook endpoint
WebhookEndpointsApiListGet /webhookEndpointsList webhook endpoints
WebhookEndpointsApiRetrieveGet /webhookEndpoints/{id}Retrieve a webhook endpoint
WebhookEndpointsApiRotateSecretPost /webhookEndpoints/{id}/rotateSecretRotate a webhook endpoint secret
WebhookEndpointsApiUpdatePatch /webhookEndpoints/{id}Update a webhook endpoint
WhatsappBusinessAccountsApiListGet /whatsapp/businessAccountsList WABAs
WhatsappBusinessAccountsApiRetrieveGet /whatsapp/businessAccounts/{id}Retrieve a WABA
WhatsappInboundMessagesApiMarkAsReadPost /whatsapp/inboundMessages/{id}/markAsReadMark message as read
WhatsappMessagesApiRetrieveGet /whatsapp/messages/{id}Retrieve a message
WhatsappMessagesApiSendPost /whatsapp/messagesEnqueue a message
WhatsappMessagesApiSendDirectlyPost /whatsapp/messages/sendDirectlySend a message directly
WhatsappPhoneNumbersApiListGet /whatsapp/phoneNumbersList phone numbers
WhatsappPhoneNumbersApiRegisterPost /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/registerRegister a phone number
WhatsappPhoneNumbersApiRetrieveGet /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}Retrieve a phone number
WhatsappPhoneNumbersApiRetrieveCommerceSettingsGet /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/whatsappCommerceSettingsRetrieve commerce settings
WhatsappPhoneNumbersApiRetrieveProfileGet /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/profileRetrieve a phone number profile
WhatsappPhoneNumbersApiUpdateCommerceSettingsPatch /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/whatsappCommerceSettingsUpdate commerce settings
WhatsappPhoneNumbersApiUpdateProfilePatch /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/profileUpdate a phone number profile
WhatsappTemplatesApiCreatePost /whatsapp/templatesCreate a template
WhatsappTemplatesApiDeleteByNameDelete /whatsapp/templates/{wabaId}/{name}Delete templates by name
WhatsappTemplatesApiDeleteByNameAndLanguageDelete /whatsapp/templates/{wabaId}/{name}/{language}Delete a template
WhatsappTemplatesApiEditByNameAndLanguagePatch /whatsapp/templates/{wabaId}/{name}/{language}Edit a template
WhatsappTemplatesApiListGet /whatsapp/templatesList templates
WhatsappTemplatesApiRetrieveByNameAndLanguageGet /whatsapp/templates/{wabaId}/{name}/{language}Retrieve a template

Documentation For Models

Documentation For Authorization

api_key

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Configure API key:

import ycloud "github.com/ycloud-developers/ycloud-sdk-go"

configuration := ycloud.NewConfiguration()
configuration.AddDefaultHeader("X-API-Key", "YOUR_API_KEY")

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime