This is the public Twilio REST API.
This Motoko client was generated by the OpenAPI Generator project.
- API version: 1.0.0
- Generator version: 7.20.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.MotokoClientCodegen
- BrandRegistrationsEnumBrandFeedback
- BrandRegistrationsEnumIdentityStatus
- BrandRegistrationsEnumStatus
- BrandVettingEnumVettingProvider
- CreateServiceRequestFallbackMethod
- CreateServiceRequestInboundMethod
- ListAlphaSenderResponse
- ListAlphaSenderResponseMeta
- ListBrandRegistrationsResponse
- ListBrandVettingResponse
- ListChannelSenderResponse
- ListDestinationAlphaSenderResponse
- ListPhoneNumberResponse
- ListServiceResponse
- ListShortCodeResponse
- ListTollfreeVerificationResponse
- ListUsAppToPersonResponse
- MessagingV1BrandRegistrations
- MessagingV1BrandRegistrationsBrandRegistrationOtp
- MessagingV1BrandRegistrationsBrandVetting
- MessagingV1Deactivation
- MessagingV1DomainCertV4
- MessagingV1DomainConfig
- MessagingV1DomainConfigMessagingService
- MessagingV1DomainDnsValidation
- MessagingV1ExternalCampaign
- MessagingV1LinkshorteningMessagingService
- MessagingV1LinkshorteningMessagingServiceDomainAssociation
- MessagingV1RequestManagedCert
- MessagingV1Service
- MessagingV1ServiceAddons
- MessagingV1ServiceAlphaSender
- MessagingV1ServiceChannelSender
- MessagingV1ServiceDestinationAlphaSender
- MessagingV1ServiceFallbackMethod
- MessagingV1ServiceGenericSender
- MessagingV1ServiceInboundMethod
- MessagingV1ServicePhoneNumber
- MessagingV1ServiceServiceForNumber
- MessagingV1ServiceShortCode
- MessagingV1ServiceUsAppToPerson
- MessagingV1ServiceUsAppToPersonResponse
- MessagingV1ServiceUsAppToPersonUsecase
- MessagingV1ServiceUsAppToPersonV2
- MessagingV1TollfreeVerification
- MessagingV1Usecase
- ServiceEnumScanMessageContent
- TollfreeVerificationEnumBusinessRegistrationAuthority
- TollfreeVerificationEnumBusinessType
- TollfreeVerificationEnumOptInType
- TollfreeVerificationEnumStatus
- TollfreeVerificationEnumUseCaseCategoriesInner
- TollfreeVerificationEnumVettingProvider
- WhatsappSenderEnumStatus
- WhatsappTemplateEnumCategory
- MessagingV1AlphaSenderApi
- MessagingV1BrandRegistrationApi
- MessagingV1BrandRegistrationOtpApi
- MessagingV1BrandVettingApi
- MessagingV1ChannelSenderApi
- MessagingV1DeactivationsApi
- MessagingV1DestinationAlphaSenderApi
- MessagingV1DomainCertsApi
- MessagingV1DomainConfigApi
- MessagingV1DomainConfigMessagingServiceApi
- MessagingV1DomainValidateDnsApi
- MessagingV1ExternalCampaignApi
- MessagingV1LinkshorteningMessagingServiceApi
- MessagingV1LinkshorteningMessagingServiceDomainAssociationApi
- MessagingV1PhoneNumberApi
- MessagingV1RequestManagedCertApi
- MessagingV1ServiceApi
- MessagingV1ShortCodeApi
- MessagingV1TollfreeVerificationApi
- MessagingV1UsAppToPersonApi
- MessagingV1UsAppToPersonUsecaseApi
- MessagingV1UsecaseApi
This is a Motoko module that can be used in your Internet Computer project.
Import the generated API modules in your Motoko code:
import SomeApi "mo:twilio-client/Apis/SomeApi";
// or using destructuring for specific functions
import { someFunction } "mo:twilio-client/Apis/SomeApi";Configure and call the API:
import { defaultConfig } "mo:twilio-client/Config";
// Use the default config as-is, or customize specific fields:
let config = { defaultConfig with auth = ?#bearer "my-token" };
let result = await* SomeApi.someFunction(config, ...);The defaultConfig has baseUrl pre-set to the API's base URL, cycles = 30_000_000_000, and all optional fields set to null.
Alternatively, use the suite-based API to bind config once and call multiple functions without threading it through each call:
import { SomeApi } "mo:twilio-client/Apis/SomeApi";
let api = SomeApi(config);
let result = await api.someFunction(...);
let other = await api.anotherFunction(...);The generated API client makes HTTP outcalls using the Internet Computer's management canister. HTTP outcalls require cycles to execute.
Important: Before calling any API endpoints, ensure your canister has sufficient cycles:
For local development:
# Get your canister ID
CANISTER_ID=$(dfx canister id your_canister_name)
# Add cycles (100 trillion cycles for testing)
dfx ledger fabricate-cycles --canister "$CANISTER_ID" --amount 100000000000000For production deployment, you'll need to fund your canister with cycles through the NNS or cycles wallet.
Each HTTP outcall typically costs around 20-50 million cycles depending on the request/response size.