# 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
Class | Method | HTTP request | Description |
---|---|---|---|
BalanceApi | Retrieve | Get /balance | Retrieve balance |
ContactsApi | Create | Post /contact/contacts | Create a contact |
ContactsApi | Delete | Delete /contact/contacts/{id} | Delete a contact |
ContactsApi | List | Get /contact/contacts | List contacts |
ContactsApi | Retrieve | Get /contact/contacts/{id} | Retrieve a contact |
ContactsApi | Update | Patch /contact/contacts/{id} | Update a contact |
CustomEventsApi | CreateDefinition | Post /event/definitions | Create an event definition |
CustomEventsApi | CreatePropertyDefinition | Post /event/definitions/{name}/properties | Create an event property definition |
CustomEventsApi | PropertyDefinition | Delete /event/definitions/{name}/properties/{propertyName} | Delete an event property definition |
CustomEventsApi | PropertyDefinition_0 | Patch /event/definitions/{name}/properties/{propertyName} | Update an event property definition |
CustomEventsApi | RetrieveDefinition | Get /event/definitions/{name} | Retrieve an event definition |
CustomEventsApi | SendEvent | Post /event/events | Send an event |
CustomEventsApi | UpdateDefinition | Patch /event/definitions/{name} | Update an event definition |
EmailsApi | Send | Post /emails | Send an email |
SmsApi | List | Get /sms | List SMS records |
SmsApi | Send | Post /sms | Send an SMS |
UnsubscribersApi | Create | Post /unsubscribers | Create an unsubscriber |
UnsubscribersApi | DeleteByCustomerAndChannel | Delete /unsubscribers/{customer}/{channel} | Delete an unsubscriber |
UnsubscribersApi | List | Get /unsubscribers | List unsubscribers |
UnsubscribersApi | ListAllByCustomer | Get /unsubscribers/{customer} | List all unsubscribers by customer |
UnsubscribersApi | RetrieveByCustomerAndChannel | Get /unsubscribers/{customer}/{channel} | Retrieve an unsubscriber |
VerifyApi | Check | Post /verify/verificationChecks | Check a verification |
VerifyApi | Send | Post /verify/verifications | Start a verification |
VoicesApi | List | Get /voices | List voice records |
VoicesApi | Send | Post /voices | Send a voice code |
WebhookEndpointsApi | Create | Post /webhookEndpoints | Create a webhook endpoint |
WebhookEndpointsApi | Delete | Delete /webhookEndpoints/{id} | Delete a webhook endpoint |
WebhookEndpointsApi | List | Get /webhookEndpoints | List webhook endpoints |
WebhookEndpointsApi | Retrieve | Get /webhookEndpoints/{id} | Retrieve a webhook endpoint |
WebhookEndpointsApi | RotateSecret | Post /webhookEndpoints/{id}/rotateSecret | Rotate a webhook endpoint secret |
WebhookEndpointsApi | Update | Patch /webhookEndpoints/{id} | Update a webhook endpoint |
WhatsappBusinessAccountsApi | List | Get /whatsapp/businessAccounts | List WABAs |
WhatsappBusinessAccountsApi | Retrieve | Get /whatsapp/businessAccounts/{id} | Retrieve a WABA |
WhatsappInboundMessagesApi | MarkAsRead | Post /whatsapp/inboundMessages/{id}/markAsRead | Mark message as read |
WhatsappMessagesApi | Retrieve | Get /whatsapp/messages/{id} | Retrieve a message |
WhatsappMessagesApi | Send | Post /whatsapp/messages | Enqueue a message |
WhatsappMessagesApi | SendDirectly | Post /whatsapp/messages/sendDirectly | Send a message directly |
WhatsappPhoneNumbersApi | List | Get /whatsapp/phoneNumbers | List phone numbers |
WhatsappPhoneNumbersApi | Register | Post /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/register | Register a phone number |
WhatsappPhoneNumbersApi | Retrieve | Get /whatsapp/phoneNumbers/{wabaId}/{phoneNumber} | Retrieve a phone number |
WhatsappPhoneNumbersApi | RetrieveCommerceSettings | Get /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/whatsappCommerceSettings | Retrieve commerce settings |
WhatsappPhoneNumbersApi | RetrieveProfile | Get /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/profile | Retrieve a phone number profile |
WhatsappPhoneNumbersApi | UpdateCommerceSettings | Patch /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/whatsappCommerceSettings | Update commerce settings |
WhatsappPhoneNumbersApi | UpdateProfile | Patch /whatsapp/phoneNumbers/{wabaId}/{phoneNumber}/profile | Update a phone number profile |
WhatsappTemplatesApi | Create | Post /whatsapp/templates | Create a template |
WhatsappTemplatesApi | DeleteByName | Delete /whatsapp/templates/{wabaId}/{name} | Delete templates by name |
WhatsappTemplatesApi | DeleteByNameAndLanguage | Delete /whatsapp/templates/{wabaId}/{name}/{language} | Delete a template |
WhatsappTemplatesApi | EditByNameAndLanguage | Patch /whatsapp/templates/{wabaId}/{name}/{language} | Edit a template |
WhatsappTemplatesApi | List | Get /whatsapp/templates | List templates |
WhatsappTemplatesApi | RetrieveByNameAndLanguage | Get /whatsapp/templates/{wabaId}/{name}/{language} | Retrieve a template |
Documentation For Models
- Balance
- Contact
- ContactCreateRequest
- ContactCustomAttribute
- ContactPage
- ContactUpdateRequest
- CustomEventDefinition
- CustomEventDefinitionCreateRequest
- CustomEventDefinitionProperty
- CustomEventDefinitionPropertyCreateRequest
- CustomEventDefinitionPropertyUpdateRequest
- CustomEventDefinitionUpdateRequest
- CustomEventSendRequest
- EmailContentType
- EmailDelivery
- EmailSendRequest
- Error
- ErrorResponse
- Event
- EventType
- Mailbox
- MetaBusinessAccountVerificationStatus
- Page
- PageCursor
- Sms
- SmsInbound
- SmsPage
- SmsSendRequest
- Unsubscriber
- UnsubscriberChannel
- UnsubscriberCreateRequest
- UnsubscriberPage
- UnsubscriberType
- Verification
- VerificationChannel
- VerificationCheck
- VerificationCheckRequest
- VerificationFallback
- VerificationSendRequest
- VerificationStatus
- Voice
- VoicePage
- VoiceSendRequest
- WebhookEndpoint
- WebhookEndpointCreateRequest
- WebhookEndpointPage
- WebhookEndpointStatus
- WebhookEndpointUpdateRequest
- WhatsappApiError
- WhatsappAuthIntlRateEligibilityCountry
- WhatsappBusinessAccount
- WhatsappBusinessAccountBanState
- WhatsappBusinessAccountPage
- WhatsappBusinessAccountRestrictionInfo
- WhatsappBusinessAccountReviewStatus
- WhatsappBusinessAccountUpdateEventEnum
- WhatsappCommerceSettings
- WhatsappCommerceSettingsUpdateRequest
- WhatsappConversation
- WhatsappConversationOriginType
- WhatsappConversationType
- WhatsappInboundMessage
- WhatsappInboundMessageButton
- WhatsappInboundMessageContext
- WhatsappInboundMessageError
- WhatsappInboundMessageInteractive
- WhatsappInboundMessageInteractiveButtonReply
- WhatsappInboundMessageInteractiveListReply
- WhatsappInboundMessageLocation
- WhatsappInboundMessageMedia
- WhatsappInboundMessageOrder
- WhatsappInboundMessageOrderProductItem
- WhatsappInboundMessageReferral
- WhatsappInboundMessageReferredProduct
- WhatsappInboundMessageSystem
- WhatsappInboundMessageText
- WhatsappInboundMessageType
- WhatsappMessage
- WhatsappMessageContact
- WhatsappMessageContactAddress
- WhatsappMessageContactEmail
- WhatsappMessageContactName
- WhatsappMessageContactOrg
- WhatsappMessageContactPhone
- WhatsappMessageContactUrl
- WhatsappMessageContext
- WhatsappMessageInteractive
- WhatsappMessageInteractiveAction
- WhatsappMessageInteractiveActionButton
- WhatsappMessageInteractiveActionButtonReply
- WhatsappMessageInteractiveActionParameters
- WhatsappMessageInteractiveActionParametersFlowActionPayload
- WhatsappMessageInteractiveActionSection
- WhatsappMessageInteractiveActionSectionProductItem
- WhatsappMessageInteractiveActionSectionRow
- WhatsappMessageInteractiveBody
- WhatsappMessageInteractiveFooter
- WhatsappMessageInteractiveHeader
- WhatsappMessageLocation
- WhatsappMessageMedia
- WhatsappMessageOrderAmount
- WhatsappMessageOrderBeneficiary
- WhatsappMessageOrderDetails
- WhatsappMessageOrderExpiration
- WhatsappMessageOrderInfo
- WhatsappMessageOrderItem
- WhatsappMessageOrderPaymentGateway
- WhatsappMessageOrderPaymentSetting
- WhatsappMessageOrderPaymentSettingPaymentGatewayBilldesk
- WhatsappMessageOrderPaymentSettingPaymentGatewayPayu
- WhatsappMessageOrderPaymentSettingPaymentGatewayRazorpay
- WhatsappMessageOrderPaymentSettingPaymentGatewayZaakpay
- WhatsappMessageOrderStatus
- WhatsappMessageOrderStatusEnum
- WhatsappMessageReaction
- WhatsappMessageSendRequest
- WhatsappMessageStatus
- WhatsappMessageTemplate
- WhatsappMessageTemplateComponent
- WhatsappMessageTemplateComponentCard
- WhatsappMessageTemplateComponentCardComponent
- WhatsappMessageTemplateComponentParameter
- WhatsappMessageTemplateComponentParameterAction
- WhatsappMessageTemplateComponentParameterActionSection
- WhatsappMessageTemplateComponentParameterActionSectionProductItem
- WhatsappMessageTemplateComponentParameterLimitedTimeOffer
- WhatsappMessageTemplateLanguage
- WhatsappMessageText
- WhatsappMessageType
- WhatsappPayment
- WhatsappPaymentStatus
- WhatsappPaymentTransaction
- WhatsappPaymentTransactionError
- WhatsappPhoneNumber
- WhatsappPhoneNumberCodeVerificationStatus
- WhatsappPhoneNumberNameStatus
- WhatsappPhoneNumberPage
- WhatsappPhoneNumberProfile
- WhatsappPhoneNumberProfileUpdateRequest
- WhatsappPhoneNumberProfileVertical
- WhatsappPhoneNumberQualityRating
- WhatsappPhoneNumberQualityUpdateEventEnum
- WhatsappPhoneNumberStatus
- WhatsappPricingCategory
- WhatsappProfile
- WhatsappReviewDecision
- WhatsappTemplate
- WhatsappTemplateCategory
- WhatsappTemplateComponent
- WhatsappTemplateComponentButton
- WhatsappTemplateComponentButtonOtpType
- WhatsappTemplateComponentButtonType
- WhatsappTemplateComponentCard
- WhatsappTemplateComponentCardComponent
- WhatsappTemplateComponentExample
- WhatsappTemplateComponentLimitedTimeOffer
- WhatsappTemplateCreateRequest
- WhatsappTemplateEditRequest
- WhatsappTemplatePage
- WhatsappTemplateQualityRating
- WhatsappTemplateStatus
- WhatsappTemplateStatusUpdateEventEnum
- WhatsappTemplateSubCategory
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