usms

package
v0.21.60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package usms include resources of ucloud usms product

See also

for detail.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchInfo added in v0.21.10

type BatchInfo struct {

	// 未能成功发送的详情。注:模板/签名检验失败时,该字段有效
	FailureDetails string

	// 签名
	SigContent string

	// 具体号码信息
	Target []FailPhoneDetail

	// 模板ID
	TemplateId string
}

BatchInfo - 批量发送任务中未能成功发送的信息详情,“模板+签名”粒度

type CreateUSMSSignatureRequest

type CreateUSMSSignatureRequest struct {
	request.CommonBase

	// 签名的资质证明文件类型,需与签名类型保持一致,说明如下:0-三证合一/企业营业执照/组织机构代码证书/社会信用代码证书;1-应用商店后台开发者管理截图;2-备案服务商的备案成功截图(含域名,网站名称,备案号);3-公众号或小程序的管理界面截图;4-商标注册证书;5-组织机构代码证书、社会信用代码证书;
	CertificateType *int `required:"true"`

	// 短信签名申请原因
	Description *string `required:"true"`

	// 短信签名的资质证明文件,需先进行base64编码格式转换,此处填写转换后的字符串。文件大小不超过4 MB
	File *string `required:"true"`

	// 国内/国际短信。true:国际短信,false:国内短信,若不传值则默认该值为false
	International *bool `required:"false"`

	// 短信签名授权委托文件,需先进行base64编码格式转换,此处填写转换后的字符串。文件大小不超过4 MB;当您是代理并使用第三方的签名时(也即SigPurpose为1-他用),该项为必填项;
	ProxyFile *string `required:"false"`

	// 签名内容
	SigContent *string `required:"true"`

	// 签名用途,0-自用,1-他用;
	SigPurpose *int `required:"true"`

	// 签名类型,说明如下:0-公司或企业的全称或简称;1-App应用的全称或简称;2-工信部备案网站的全称或简称;3-公众号或小程序的全称或简称;4-商标名的全称或简称;5-政府/机关事业单位/其他单位的全称或简称;
	SigType *int `required:"true"`
}

CreateUSMSSignatureRequest is request schema for CreateUSMSSignature action

type CreateUSMSSignatureResponse

type CreateUSMSSignatureResponse struct {
	response.CommonBase

	// 返回状态码描述,如果操作成功,默认返回为空
	Message string

	// 短信签名ID(短信签名申请时的工单ID)
	SigId string
}

CreateUSMSSignatureResponse is response schema for CreateUSMSSignature action

type CreateUSMSTemplateRequest

type CreateUSMSTemplateRequest struct {
	request.CommonBase

	// 模板变量属性说明
	Instruction *string `required:"false"`

	// 标记是否为国际短信。true:国际短信,false:国内短信,若不传值则默认该值为false
	International *bool `required:"false"`

	// 短信模板用途类型:1-验证码类短信模板;2-系统通知类短信模板;3-会员推广类短信模板;
	Purpose *int `required:"true"`

	// 短信模板申请原因说明,字数不超过128,每个中文、符号、英文、数字等都计为1个字。
	Remark *string `required:"false"`

	// 短信模板内容,说明如下:字数不超过500,每个中文、符号、英文、数组等都计为一个字;模板中的变量填写格式:{N},其中N为大于1的整数,有多个参数时,建议N从1开始顺次,例如:{1}、{2}等;短信模板禁止仅包括变量的情况;
	Template *string `required:"true"`

	// 短信模板名称,不超过32个字符,每个中文、符号、英文、数字等都计为1个字。
	TemplateName *string `required:"true"`

	// 当Purpose为3时,也即会员推广类短信模板,该项必填。枚举值:TD退订、回T退订、回N退订、回TD退订、退订回T、退订回D、退订回TD、退订回复T、退订回复D、退订回复N、退订回复TD、拒收回T
	UnsubscribeInfo *string `required:"false"`
}

CreateUSMSTemplateRequest is request schema for CreateUSMSTemplate action

type CreateUSMSTemplateResponse

type CreateUSMSTemplateResponse struct {
	response.CommonBase

	// 返回状态码描述,如果操作成功,默认返回为空
	Message string

	// 短信模板ID(短信模板申请时的工单ID)
	TemplateId string
}

CreateUSMSTemplateResponse is response schema for CreateUSMSTemplate action

type DeleteUSMSSignatureRequest

type DeleteUSMSSignatureRequest struct {
	request.CommonBase

	// 签名ID(也即短信签名申请时的工单ID),支持以数组的方式,举例,以SigIds.0、SigIds.1...SigIds.N方式传入
	SigIds []string `required:"true"`
}

DeleteUSMSSignatureRequest is request schema for DeleteUSMSSignature action

type DeleteUSMSSignatureResponse

type DeleteUSMSSignatureResponse struct {
	response.CommonBase

	// 返回状态码描述,如果操作成功,默认返回为空
	Message string
}

DeleteUSMSSignatureResponse is response schema for DeleteUSMSSignature action

type DeleteUSMSTemplateRequest

type DeleteUSMSTemplateRequest struct {
	request.CommonBase

	// 模板ID(也即短信模板申请时的工单ID),支持以数组的方式,举例,以TemplateIds.0、TemplateIds.1...TemplateIds.N方式传入
	TemplateIds []string `required:"true"`
}

DeleteUSMSTemplateRequest is request schema for DeleteUSMSTemplate action

type DeleteUSMSTemplateResponse

type DeleteUSMSTemplateResponse struct {
	response.CommonBase

	// 返回状态码描述,如果操作成功,默认返回为空
	Message string
}

DeleteUSMSTemplateResponse is response schema for DeleteUSMSTemplate action

type FailPhoneDetail added in v0.21.10

type FailPhoneDetail struct {

	// 扩展号码
	ExtendCode string

	// 发送失败原因。注:若模板/签名校验失败,该字段为空
	FailureDetails string

	// 手机号
	Phone string

	// 模板参数
	TemplateParams []string

	// 用户自定义ID
	UserId string
}

FailPhoneDetail - 批量任务中,未能成功发送的号码及其原因

type GetUSMSSendReceiptRequest

type GetUSMSSendReceiptRequest struct {
	request.CommonBase

	// 发送短信时返回的SessionNo集合,SessionNoSet.0,SessionNoSet.1....格式,单次调用集合数需控制在100个以内
	SessionNoSet []string `required:"true"`
}

GetUSMSSendReceiptRequest is request schema for GetUSMSSendReceipt action

type GetUSMSSendReceiptResponse

type GetUSMSSendReceiptResponse struct {
	response.CommonBase

	// 回执信息集合
	Data []ReceiptPerSession

	// 错误描述
	Message string
}

GetUSMSSendReceiptResponse is response schema for GetUSMSSendReceipt action

type OutSignature

type OutSignature struct {

	// 签名审核失败原因
	ErrDesc string

	// 签名内容
	SigContent string

	// 签名ID
	SigId string

	// 签名状态。0-待审核 1-审核中 2-审核通过 3-审核未通过 4-被禁用
	Status int
}

OutSignature - 短信签名

type OutTemplate

type OutTemplate struct {

	// 创建时间
	CreateTime int

	// 审核失败原因
	ErrDesc string

	// 模板变量属性说明
	Instruction string

	// 模板类型,选项:1-验证码类 2-通知类 3-会员推广类
	Purpose int

	// 模板说明
	Remark string

	// 短信模板状态;状态说明:0-待审核,1-审核中,2-审核通过,3-审核未通过,4-被禁用
	Status int

	// 短信模板内容
	Template string

	// 短信模板ID
	TemplateId string

	// 短信模板名称
	TemplateName string

	// 退订信息;一般填写方式“回T退订”,当purpose为3(也即会员推广类)时,为必填项
	UnsubscribeInfo string
}

OutTemplate - 短信模板

type QueryUSMSSignatureRequest

type QueryUSMSSignatureRequest struct {
	request.CommonBase

	// 签名内容;签名ID和签名至少需填写1项;
	SigContent *string `required:"false"`

	// 已申请的短信签名ID(短信签名申请时的工单ID);签名ID和签名至少需填写1项;
	SigId *string `required:"false"`
}

QueryUSMSSignatureRequest is request schema for QueryUSMSSignature action

type QueryUSMSSignatureResponse

type QueryUSMSSignatureResponse struct {
	response.CommonBase

	// 签名信息
	Data OutSignature

	// 发生错误时,表示具体错误描述
	Message string
}

QueryUSMSSignatureResponse is response schema for QueryUSMSSignature action

type QueryUSMSTemplateRequest

type QueryUSMSTemplateRequest struct {
	request.CommonBase

	// 模板ID
	TemplateId *string `required:"true"`
}

QueryUSMSTemplateRequest is request schema for QueryUSMSTemplate action

type QueryUSMSTemplateResponse

type QueryUSMSTemplateResponse struct {
	response.CommonBase

	// 短信模板明细信息,各字段说明详见OutTemplate
	Data OutTemplate

	// 当RetCode不为0时,Message中显示具体错误描述
	Message string
}

QueryUSMSTemplateResponse is response schema for QueryUSMSTemplate action

type ReceiptPerPhone

type ReceiptPerPhone struct {

	// 消耗短信条数
	CostCount int

	// 手机号码
	Phone string

	// 状态报告编码
	ReceiptCode string

	// 回执结果描述
	ReceiptDesc string

	// 回执结果,枚举值:\\ > 发送成功: 代表成功 \\ > Success: 代表成功 \\ > 发送失败: 代表失败 \\ > Fail: 代表失败 \\ > 状态未知: 代表未知 \\ > Unknow: 代表未知
	ReceiptResult string

	// 回执返回时间
	ReceiptTime int

	// 自定义的业务标识ID,字符串
	UserId string
}

ReceiptPerPhone - 每个目的手机号的发送回执信息

type ReceiptPerSession

type ReceiptPerSession struct {

	// 每个手机号的短信回执信息集合
	ReceiptSet []ReceiptPerPhone

	// 发送短信时返回的SessionNo
	SessionNo string
}

ReceiptPerSession - 每个提交的回执结果集合

type SendBatchUSMSMessageRequest added in v0.21.10

type SendBatchUSMSMessageRequest struct {
	request.CommonBase

	// 批量发送内容,该参数是json数组的base64编码结果。发送内容json数组中,每个“模板+签名”组合作为一个子项,每个子项内支持多个号码,示例:发送内容json数组(base64编码前):[{"TemplateId": "UTA20212831C85C", "SigContent": "UCloud", "Target": [{"TemplateParams": ["123456"], "Phone": "18500000123", "ExtendCode": "123", "UserId": "456"} ] } ]   。json数组中各参数的定义:"TemplateId":模板ID,"SigContent"短信签名内容,"Target"具体到号码粒度的发送内容。"Target"中的具体字段有:"TemplateParams"实际发送的模板参数(若使用的是无参数模板,该参数不能传值),"Phone"手机号码, "ExtendCode"短信扩展码, "UserId"自定义业务标识ID。其中必传参数为"TemplateId", "SigContent", "Target"("Target"中必传参数为"Phone")。实际调用本接口时TaskContent传值(发送内容base64编码后)为:W3siVGVtcGxhdGVJZCI6ICJVVEEyMDIxMjgzMUM4NUMiLCAiU2lnQ29udGVudCI6ICJVQ2xvdWQiLCAiVGFyZ2V0IjogW3siVGVtcGxhdGVQYXJhbXMiOiBbIjEyMzQ1NiJdLCAiUGhvbmUiOiAiMTg1MDAwMDAxMjMiLCAiRXh0ZW5kQ29kZSI6ICIxMjMiLCAiVXNlcklkIjogIjQ1NiJ9IF0gfSBdIA==
	TaskContent *string `required:"true"`
}

SendBatchUSMSMessageRequest is request schema for SendBatchUSMSMessage action

type SendBatchUSMSMessageResponse added in v0.21.10

type SendBatchUSMSMessageResponse struct {
	response.CommonBase

	// 未发送成功的详情,返回码非0时该字段有效,可根据该字段数据重发
	FailContent []BatchInfo

	// 发生错误时表示错误描述
	Message string

	// 本次请求Uuid
	ReqUuid string

	// 本次提交发送任务的唯一ID,可根据该值查询本次发送的短信列表。注:成功提交短信数大于0时,才返回该字段
	SessionNo string

	// 成功提交短信(未拆分)条数
	SuccessCount int
}

SendBatchUSMSMessageResponse is response schema for SendBatchUSMSMessage action

type SendUSMSMessageRequest

type SendUSMSMessageRequest struct {
	request.CommonBase

	// 短信扩展码,格式为阿拉伯数字串,默认不开通,如需开通请联系 UCloud技术支持
	ExtendCode *string `required:"false"`

	// 电话号码数组,电话号码格式为(60)1xxxxxxxx,()中为国际长途区号(如中国为86或0086,两种格式都支持),后面为电话号码.若不传入国际区号,如1851623xxxx,则默认为国内手机号
	PhoneNumbers []string `required:"true"`

	// 短信签名内容,请到[USMS控制台](https://console.ucloud.cn/usms)的签名管理页面查看;使用的短信签名必须是已申请并且通过审核;
	SigContent *string `required:"false"`

	// 模板ID(也即短信模板申请时的工单ID),请到[USMS控制台](https://console.ucloud.cn/usms)的模板管理页面查看;使用的短信模板必须是已申请并通过审核;
	TemplateId *string `required:"true"`

	// 模板可变参数,以数组的方式填写,举例,TemplateParams.0,TemplateParams.1,... 若模板中无可变参数,则该项可不填写;若模板中有可变参数,则该项为必填项,参数个数需与变量个数保持一致,否则无法发送;
	TemplateParams []string `required:"false"`

	// 自定义的业务标识ID,字符串( 长度不能超过32 位),不支持 单引号、表情包符号等特殊字符
	UserId *string `required:"false"`
}

SendUSMSMessageRequest is request schema for SendUSMSMessage action

type SendUSMSMessageResponse

type SendUSMSMessageResponse struct {
	response.CommonBase

	// 发生错误时表示错误描述
	Message string

	// 本次提交发送的短信的唯一ID,可根据该值查询本次发送的短信列表
	SessionNo string

	// 本次提交的自定义业务标识ID,仅当发送时传入有效的UserId,才返回该字段。
	UserId string
}

SendUSMSMessageResponse is response schema for SendUSMSMessage action

type USMSClient

type USMSClient struct {
	*ucloud.Client
}

USMSClient is the client of USMS

func NewClient

func NewClient(config *ucloud.Config, credential *auth.Credential) *USMSClient

NewClient will return a instance of USMSClient

func (*USMSClient) CreateUSMSSignature

API: CreateUSMSSignature

调用接口CreateUSMSSignature申请短信签名

func (*USMSClient) CreateUSMSTemplate

func (c *USMSClient) CreateUSMSTemplate(req *CreateUSMSTemplateRequest) (*CreateUSMSTemplateResponse, error)

API: CreateUSMSTemplate

调用接口CreateUSMSTemplate申请短信模板

func (*USMSClient) DeleteUSMSSignature

API: DeleteUSMSSignature

调用接口DeleteUSMSSignature删除短信签名

func (*USMSClient) DeleteUSMSTemplate

func (c *USMSClient) DeleteUSMSTemplate(req *DeleteUSMSTemplateRequest) (*DeleteUSMSTemplateResponse, error)

API: DeleteUSMSTemplate

调用接口DeleteUSMSTemplate删除短信模板

func (*USMSClient) GetUSMSSendReceipt

func (c *USMSClient) GetUSMSSendReceipt(req *GetUSMSSendReceiptRequest) (*GetUSMSSendReceiptResponse, error)

API: GetUSMSSendReceipt

调用接口GetUSMSSendReceipt短信发送状态信息

func (*USMSClient) NewCreateUSMSSignatureRequest

func (c *USMSClient) NewCreateUSMSSignatureRequest() *CreateUSMSSignatureRequest

NewCreateUSMSSignatureRequest will create request of CreateUSMSSignature action.

func (*USMSClient) NewCreateUSMSTemplateRequest

func (c *USMSClient) NewCreateUSMSTemplateRequest() *CreateUSMSTemplateRequest

NewCreateUSMSTemplateRequest will create request of CreateUSMSTemplate action.

func (*USMSClient) NewDeleteUSMSSignatureRequest

func (c *USMSClient) NewDeleteUSMSSignatureRequest() *DeleteUSMSSignatureRequest

NewDeleteUSMSSignatureRequest will create request of DeleteUSMSSignature action.

func (*USMSClient) NewDeleteUSMSTemplateRequest

func (c *USMSClient) NewDeleteUSMSTemplateRequest() *DeleteUSMSTemplateRequest

NewDeleteUSMSTemplateRequest will create request of DeleteUSMSTemplate action.

func (*USMSClient) NewGetUSMSSendReceiptRequest

func (c *USMSClient) NewGetUSMSSendReceiptRequest() *GetUSMSSendReceiptRequest

NewGetUSMSSendReceiptRequest will create request of GetUSMSSendReceipt action.

func (*USMSClient) NewQueryUSMSSignatureRequest

func (c *USMSClient) NewQueryUSMSSignatureRequest() *QueryUSMSSignatureRequest

NewQueryUSMSSignatureRequest will create request of QueryUSMSSignature action.

func (*USMSClient) NewQueryUSMSTemplateRequest

func (c *USMSClient) NewQueryUSMSTemplateRequest() *QueryUSMSTemplateRequest

NewQueryUSMSTemplateRequest will create request of QueryUSMSTemplate action.

func (*USMSClient) NewSendBatchUSMSMessageRequest added in v0.21.10

func (c *USMSClient) NewSendBatchUSMSMessageRequest() *SendBatchUSMSMessageRequest

NewSendBatchUSMSMessageRequest will create request of SendBatchUSMSMessage action.

func (*USMSClient) NewSendUSMSMessageRequest

func (c *USMSClient) NewSendUSMSMessageRequest() *SendUSMSMessageRequest

NewSendUSMSMessageRequest will create request of SendUSMSMessage action.

func (*USMSClient) NewUpdateUSMSSignatureRequest

func (c *USMSClient) NewUpdateUSMSSignatureRequest() *UpdateUSMSSignatureRequest

NewUpdateUSMSSignatureRequest will create request of UpdateUSMSSignature action.

func (*USMSClient) NewUpdateUSMSTemplateRequest

func (c *USMSClient) NewUpdateUSMSTemplateRequest() *UpdateUSMSTemplateRequest

NewUpdateUSMSTemplateRequest will create request of UpdateUSMSTemplate action.

func (*USMSClient) QueryUSMSSignature

func (c *USMSClient) QueryUSMSSignature(req *QueryUSMSSignatureRequest) (*QueryUSMSSignatureResponse, error)

API: QueryUSMSSignature

调用接口QueryUSMSSignature查询短信签名申请状态

func (*USMSClient) QueryUSMSTemplate

func (c *USMSClient) QueryUSMSTemplate(req *QueryUSMSTemplateRequest) (*QueryUSMSTemplateResponse, error)

API: QueryUSMSTemplate

调用接口QueryUSMSTemplate查询短信模板申请状态

func (*USMSClient) SendBatchUSMSMessage added in v0.21.10

API: SendBatchUSMSMessage

调用SendBatchUSMSMessage接口批量发送短信

func (*USMSClient) SendUSMSMessage

func (c *USMSClient) SendUSMSMessage(req *SendUSMSMessageRequest) (*SendUSMSMessageResponse, error)

API: SendUSMSMessage

调用接口SendUSMSMessage发送短信

func (*USMSClient) UpdateUSMSSignature

API: UpdateUSMSSignature

调用接口UpdateUSMSSignature修改未通过审核的短信签名,并重新提交审核

func (*USMSClient) UpdateUSMSTemplate

func (c *USMSClient) UpdateUSMSTemplate(req *UpdateUSMSTemplateRequest) (*UpdateUSMSTemplateResponse, error)

API: UpdateUSMSTemplate

调用接口UpdateUSMSTemplate修改未通过审核的短信模板,并重新提交审核

type UpdateUSMSSignatureRequest

type UpdateUSMSSignatureRequest struct {
	request.CommonBase

	// 签名的资质证明文件类型,需与签名类型保持一致,说明如下:0-三证合一/企业营业执照/组织机构代码证书/社会信用代码证书;1-应用商店后台开发者管理截图;2-备案服务商的备案成功截图(含域名,网站名称,备案号);3-公众号或小程序的管理界面截图;4-商标注册证书;5-组织机构代码证书、社会信用代码证书;
	CertificateType *int `required:"false"`

	// 短信签名的资质证明文件URL,若未更改审核材料,则该处使用已上传审核材料的URL链接,否则使用File参数
	Document *string `required:"false"`

	// 短信签名的资质证明文件内容,需先进行base64编码格式转换,此处填写转换后的字符串。文件大小不超过4 MB。内容格式如下: [file type];[code type],[base64]  如:image/jpeg;base64,5YaF5a65
	File *string `required:"false"`

	// 短信签名授权委托文件URL,若未更改授权委托文件,则该处填写已上传的授权委托文件的URL链接,否则使用ProxyFile参数
	ProxyDoc *string `required:"false"`

	// 短信签名授权委托文件内容,需先进行base64编码格式转换,此处填写转换后的字符串。文件大小不超过4 MB;当您是代理并使用第三方的签名时(也即SigPurpose为1-他用),该项为必填项;格式和File类似。
	ProxyFile *string `required:"false"`

	// 新的短信签名内容;长度为2-12个字符, 可包含中文、数字和符号;无需填写【】或[],系统会自动添加
	SigContent *string `required:"true"`

	// 签名ID(也即短信签名申请时的工单ID),支持以数组的方式,举例,以SigIds.0、SigIds.1...SigIds.N方式传入
	SigId *string `required:"true"`

	// 签名用途,0-自用,1-他用;
	SigPurpose *int `required:"true"`

	// 签名类型,说明如下:0-公司或企业的全称或简称;1-App应用的全称或简称;2-工信部备案网站的全称或简称;3-公众号或小程序的全称或简称;4-商标名的全称或简称;5-政府/机关事业单位/其他单位的全称或简称;
	SigType *int `required:"true"`
}

UpdateUSMSSignatureRequest is request schema for UpdateUSMSSignature action

type UpdateUSMSSignatureResponse

type UpdateUSMSSignatureResponse struct {
	response.CommonBase

	// 返回状态码描述,如果操作成功,默认返回为空
	Message string
}

UpdateUSMSSignatureResponse is response schema for UpdateUSMSSignature action

type UpdateUSMSTemplateRequest

type UpdateUSMSTemplateRequest struct {
	request.CommonBase

	// 模板变量属性说明
	Instruction *string `required:"false"`

	// 短信模板申请原因说明,字数不超过128,每个中文、符号、英文、数字等都计为1个字。
	Remark *string `required:"false"`

	// 新的模板内容。模板名称和模板内容必须提供一个,否则会报错。小于等于600个字
	Template *string `required:"true"`

	// 短信模板ID
	TemplateId *string `required:"true"`

	// 新的模板名称。小于等于32个字,每个中文、英文、数组、符合都计为一个字
	TemplateName *string `required:"false"`
}

UpdateUSMSTemplateRequest is request schema for UpdateUSMSTemplate action

type UpdateUSMSTemplateResponse

type UpdateUSMSTemplateResponse struct {
	response.CommonBase

	// 发生错误时表示错误描述
	Message string
}

UpdateUSMSTemplateResponse is response schema for UpdateUSMSTemplate action

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL