Documentation ¶
Overview ¶
Package usms include resources of ucloud usms product
See also
- API: https://docs.ucloud.cn/api/usms-api/index
- Product: https://www.ucloud.cn/site/product/usms.html
for detail.
Index ¶
- type CreateUSMSSignatureRequest
- type CreateUSMSSignatureResponse
- type CreateUSMSTemplateRequest
- type CreateUSMSTemplateResponse
- type DeleteUSMSSignatureRequest
- type DeleteUSMSSignatureResponse
- type DeleteUSMSTemplateRequest
- type DeleteUSMSTemplateResponse
- type GetUSMSSendReceiptRequest
- type GetUSMSSendReceiptResponse
- type OutSignature
- type OutTemplate
- type QueryUSMSSignatureRequest
- type QueryUSMSSignatureResponse
- type QueryUSMSTemplateRequest
- type QueryUSMSTemplateResponse
- type ReceiptPerPhone
- type ReceiptPerSession
- type SendUSMSMessageRequest
- type SendUSMSMessageResponse
- type USMSClient
- func (c *USMSClient) CreateUSMSSignature(req *CreateUSMSSignatureRequest) (*CreateUSMSSignatureResponse, error)
- func (c *USMSClient) CreateUSMSTemplate(req *CreateUSMSTemplateRequest) (*CreateUSMSTemplateResponse, error)
- func (c *USMSClient) DeleteUSMSSignature(req *DeleteUSMSSignatureRequest) (*DeleteUSMSSignatureResponse, error)
- func (c *USMSClient) DeleteUSMSTemplate(req *DeleteUSMSTemplateRequest) (*DeleteUSMSTemplateResponse, error)
- func (c *USMSClient) GetUSMSSendReceipt(req *GetUSMSSendReceiptRequest) (*GetUSMSSendReceiptResponse, error)
- func (c *USMSClient) NewCreateUSMSSignatureRequest() *CreateUSMSSignatureRequest
- func (c *USMSClient) NewCreateUSMSTemplateRequest() *CreateUSMSTemplateRequest
- func (c *USMSClient) NewDeleteUSMSSignatureRequest() *DeleteUSMSSignatureRequest
- func (c *USMSClient) NewDeleteUSMSTemplateRequest() *DeleteUSMSTemplateRequest
- func (c *USMSClient) NewGetUSMSSendReceiptRequest() *GetUSMSSendReceiptRequest
- func (c *USMSClient) NewQueryUSMSSignatureRequest() *QueryUSMSSignatureRequest
- func (c *USMSClient) NewQueryUSMSTemplateRequest() *QueryUSMSTemplateRequest
- func (c *USMSClient) NewSendUSMSMessageRequest() *SendUSMSMessageRequest
- func (c *USMSClient) NewUpdateUSMSSignatureRequest() *UpdateUSMSSignatureRequest
- func (c *USMSClient) NewUpdateUSMSTemplateRequest() *UpdateUSMSTemplateRequest
- func (c *USMSClient) QueryUSMSSignature(req *QueryUSMSSignatureRequest) (*QueryUSMSSignatureResponse, error)
- func (c *USMSClient) QueryUSMSTemplate(req *QueryUSMSTemplateRequest) (*QueryUSMSTemplateResponse, error)
- func (c *USMSClient) SendUSMSMessage(req *SendUSMSMessageRequest) (*SendUSMSMessageResponse, error)
- func (c *USMSClient) UpdateUSMSSignature(req *UpdateUSMSSignatureRequest) (*UpdateUSMSSignatureResponse, error)
- func (c *USMSClient) UpdateUSMSTemplate(req *UpdateUSMSTemplateRequest) (*UpdateUSMSTemplateResponse, error)
- type UpdateUSMSSignatureRequest
- type UpdateUSMSSignatureResponse
- type UpdateUSMSTemplateRequest
- type UpdateUSMSTemplateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"` // 签名用途,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 // 标记是否为国际短信。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"` }
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 GetUSMSSendReceiptRequest ¶
type GetUSMSSendReceiptRequest struct { request.CommonBase // 发送短信时返回的SessionNo集合,SessionNoSet.0,SessionNoSet.1....格式 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 // 模板类型,选项: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 // 回执结果描述 ReceiptDesc string // 回执结果 ReceiptResult string // 回执返回时间 ReceiptTime int }
ReceiptPerPhone - 每个目的手机号的发送回执信息
type ReceiptPerSession ¶
type ReceiptPerSession struct { // 每个手机号的短信回执信息集合 ReceiptSet []ReceiptPerPhone // 发送短信时返回的SessionNo SessionNo string }
ReceiptPerSession - 每个提交的回执结果集合
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:"true"` // 模板ID(也即短信模板申请时的工单ID),请到[USMS控制台](https://console.ucloud.cn/usms)的模板管理页面查看;使用的短信模板必须是已申请并通过审核; TemplateId *string `required:"true"` // 模板可变参数,以数组的方式填写,举例,TempalteParams.0,TempalteParams.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 ¶
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 ¶
func (c *USMSClient) CreateUSMSSignature(req *CreateUSMSSignatureRequest) (*CreateUSMSSignatureResponse, error)
API: CreateUSMSSignature
调用接口CreateUSMSSignature申请短信签名
func (*USMSClient) CreateUSMSTemplate ¶
func (c *USMSClient) CreateUSMSTemplate(req *CreateUSMSTemplateRequest) (*CreateUSMSTemplateResponse, error)
API: CreateUSMSTemplate
调用接口CreateUSMSTemplate申请短信模板
func (*USMSClient) DeleteUSMSSignature ¶
func (c *USMSClient) DeleteUSMSSignature(req *DeleteUSMSSignatureRequest) (*DeleteUSMSSignatureResponse, error)
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) 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) SendUSMSMessage ¶
func (c *USMSClient) SendUSMSMessage(req *SendUSMSMessageRequest) (*SendUSMSMessageResponse, error)
API: SendUSMSMessage
调用接口SendUSMSMessage发送短信
func (*USMSClient) UpdateUSMSSignature ¶
func (c *USMSClient) UpdateUSMSSignature(req *UpdateUSMSSignatureRequest) (*UpdateUSMSSignatureResponse, error)
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 // 短信模板申请原因说明,字数不超过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