dysmsapi-20170525/main.tea (6,237 lines of code) (raw):

/** * */ import Util; import OpenApi; import OpenApiUtil; import EndpointUtil; extends OpenApi; init(config: OpenApi.Config){ super(config); @endpointRule = 'central'; @endpointMap = { 'ap-southeast-1' = 'dysmsapi.ap-southeast-1.aliyuncs.com', 'ap-southeast-5' = 'dysmsapi.ap-southeast-5.aliyuncs.com', 'cn-beijing' = 'dysmsapi-proxy.cn-beijing.aliyuncs.com', 'cn-hongkong' = 'dysmsapi-xman.cn-hongkong.aliyuncs.com', 'eu-central-1' = 'dysmsapi.eu-central-1.aliyuncs.com', 'us-east-1' = 'dysmsapi.us-east-1.aliyuncs.com', }; checkConfig(config); @endpoint = getEndpoint('dysmsapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint); } function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{ if (!Util.empty(endpoint)) { return endpoint; } if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) { return endpointMap[regionId]; } return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); } model AddExtCodeSignRequest { extCode?: string(name='ExtCode', description='扩展码A3 This parameter is required.', example='01'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名 This parameter is required.', example='示例值'), } model AddExtCodeSignResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: boolean(name='Data', example='true'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model AddExtCodeSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: AddExtCodeSignResponseBody(name='body'), } /** * @summary 添加验证码签名信息 * * @param request AddExtCodeSignRequest * @param runtime runtime options for this request RuntimeOptions * @return AddExtCodeSignResponse */ async function addExtCodeSignWithOptions(request: AddExtCodeSignRequest, runtime: Util.RuntimeOptions): AddExtCodeSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.extCode)) { query['ExtCode'] = request.extCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'AddExtCodeSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 添加验证码签名信息 * * @param request AddExtCodeSignRequest * @return AddExtCodeSignResponse */ async function addExtCodeSign(request: AddExtCodeSignRequest): AddExtCodeSignResponse { var runtime = new Util.RuntimeOptions{}; return addExtCodeSignWithOptions(request, runtime); } model AddShortUrlRequest { effectiveDays?: string(name='EffectiveDays', description='The validity period of the short URL. Unit: days. The maximum validity period is 90 days. This parameter is required.', example='7'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), shortUrlName?: string(name='ShortUrlName', description='The service name of the short URL. The name cannot exceed 13 characters in length. This parameter is required.', example='The Alibaba Cloud Short Link service.'), sourceUrl?: string(name='SourceUrl', description='The source URL. The URL cannot exceed 1,000 characters in length. This parameter is required.', example='https://www.****.com/product/sms'), } model AddShortUrlResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { expireDate?: string(name='ExpireDate', description='The time when the short URL expires. > The value of **ExpireDate** is on the hour.', example='2021-09-19 00:00:00'), shortUrl?: string(name='ShortUrl', description='The short URL.', example='http://****.cn/6y8uy7'), sourceUrl?: string(name='SourceUrl', description='The source URL.', example='https://www.****.com/product/sms'), }(name='Data', description='The details of the short URL.'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), } model AddShortUrlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: AddShortUrlResponseBody(name='body'), } /** * @summary Creates a short URL. * * @description * Before you call this operation, you must register the primary domain name of the source URL in the Short Message Service (SMS) console. After the domain name is registered, you can call this operation to create a short URL. For more information, see [Domain name registration](https://help.aliyun.com/document_detail/302325.html#title-mau-zdh-hd0). * * You can create up to 3,000 short URLs within a natural day. * * After a short URL is generated, a security review is required. Generally, the review takes 10 minutes to 2 hours to complete. Before the security review is passed, the short URL cannot be directly accessed. * * @param request AddShortUrlRequest * @param runtime runtime options for this request RuntimeOptions * @return AddShortUrlResponse */ async function addShortUrlWithOptions(request: AddShortUrlRequest, runtime: Util.RuntimeOptions): AddShortUrlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var body : map[string]any = {}; if (!Util.isUnset(request.effectiveDays)) { body['EffectiveDays'] = request.effectiveDays; } if (!Util.isUnset(request.shortUrlName)) { body['ShortUrlName'] = request.shortUrlName; } if (!Util.isUnset(request.sourceUrl)) { body['SourceUrl'] = request.sourceUrl; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'AddShortUrl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Creates a short URL. * * @description * Before you call this operation, you must register the primary domain name of the source URL in the Short Message Service (SMS) console. After the domain name is registered, you can call this operation to create a short URL. For more information, see [Domain name registration](https://help.aliyun.com/document_detail/302325.html#title-mau-zdh-hd0). * * You can create up to 3,000 short URLs within a natural day. * * After a short URL is generated, a security review is required. Generally, the review takes 10 minutes to 2 hours to complete. Before the security review is passed, the short URL cannot be directly accessed. * * @param request AddShortUrlRequest * @return AddShortUrlResponse */ async function addShortUrl(request: AddShortUrlRequest): AddShortUrlResponse { var runtime = new Util.RuntimeOptions{}; return addShortUrlWithOptions(request, runtime); } model AddSmsSignRequest { ownerId?: long(name='OwnerId'), remark?: string(name='Remark', description='The description of the signature application. The description cannot exceed 200 characters in length. The description is one of the reference information for signature review. We recommend that you describe the use scenarios of your services in detail, and provide information that can verify the services, such as a website URL, a domain name with an ICP filing, an app download URL, an official account name, or a mini program name. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. This parameter is required.', example='This is the abbreviation of our company.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signFileList?: [ { fileContents?: string(name='FileContents', description='The Base64-encoded string of the qualification document. An image cannot exceed 2 MB in size. In some scenarios, you must upload supporting documents to apply for signatures. For more information, see [SMS signature specifications](https://help.aliyun.com/document_detail/108076.html). This parameter is required.', example='R0lGODlhHAAmAKIHAKqqqsvLy0hISObm5vf394uL****'), fileSuffix?: string(name='FileSuffix', description='The format of the qualification document. You can upload multiple images. Images in JPG, PNG, GIF, or JPEG format are supported. In some scenarios, you must upload supporting documents to apply for signatures. For more information, see [SMS signature specifications](https://help.aliyun.com/document_detail/108076.html). > If you apply for a signature for other users or if the signature source is the name of an enterprise or public institution, you must upload a certificate and a letter of authorization. For more information, see [Certificate](https://help.aliyun.com/document_detail/108076.html) and [Letter of authorization](https://help.aliyun.com/document_detail/56741.html). This parameter is required.', example='jpg'), } ](name='SignFileList', description='The signature files. This parameter is required.'), signName?: string(name='SignName', description='The name of the signature. > * The signature name is not case-sensitive. For example, [Alibaba Cloud Communication] and [alibaba cloud communication] are considered as the same name. * If your verification code signature and general-purpose signature have the same name, the system uses the general-purpose signature to send messages by default. This parameter is required.', example='Aliyun'), signSource?: int32(name='SignSource', description='The source of the signature. Valid values: * **0**: the full name or abbreviation of an enterprise or institution * **1**: the full name or abbreviation of a website that has obtained an ICP filing from the Ministry of Industry and Information Technology (MIIT) of China * **2**: the full name or abbreviation of an app * **3**: the full name or abbreviation of an official account or mini-program * **4**: the full name or abbreviation of an e-commerce store * **5**: the full name or abbreviation of a trademark This parameter is required.', example='1'), signType?: int32(name='SignType', description='The type of the signature. Valid values: * **0**: verification code * **1**: general-purpose', example='1'), } model AddSmsSignResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), signName?: string(name='SignName', description='The name of the signature.', example='Aliyun'), } model AddSmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: AddSmsSignResponseBody(name='body'), } /** * @summary Creates a signature. * * @description You can call the AddSmsSign operation or use the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm#/overview) to create an SMS signature. The signature must comply with the [SMS signature specifications](https://help.aliyun.com/document_detail/108076.html). You can call the QuerySmsSign operation or use the SMS console to query the review status of the signature. * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limit * You can call this operation only once per second. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * > * * You cannot cancel the review of a signature. * * Individual users can create only one verification code signature, and can create only one general-purpose signature within a natural day. If you need to apply for multiple signatures, we recommend that you upgrade your account to an enterprise user. * * If you need to use the same signature for messages sent to recipients both in and outside the Chinese mainland, the signature must be a general-purpose signature. * * If you apply for a signature or message template, you must specify the signature scenario or template type. You must also provide the information of your services, such as a website URL, a domain name with an ICP filing, an application download URL, or the name of your WeChat official account or mini program. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. * * An SMS signature must undergo a thorough review process before it can be approved for use. * * @param request AddSmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return AddSmsSignResponse */ async function addSmsSignWithOptions(request: AddSmsSignRequest, runtime: Util.RuntimeOptions): AddSmsSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.signSource)) { query['SignSource'] = request.signSource; } if (!Util.isUnset(request.signType)) { query['SignType'] = request.signType; } var body : map[string]any = {}; if (!Util.isUnset(request.signFileList)) { body['SignFileList'] = request.signFileList; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'AddSmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Creates a signature. * * @description You can call the AddSmsSign operation or use the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm#/overview) to create an SMS signature. The signature must comply with the [SMS signature specifications](https://help.aliyun.com/document_detail/108076.html). You can call the QuerySmsSign operation or use the SMS console to query the review status of the signature. * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limit * You can call this operation only once per second. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * > * * You cannot cancel the review of a signature. * * Individual users can create only one verification code signature, and can create only one general-purpose signature within a natural day. If you need to apply for multiple signatures, we recommend that you upgrade your account to an enterprise user. * * If you need to use the same signature for messages sent to recipients both in and outside the Chinese mainland, the signature must be a general-purpose signature. * * If you apply for a signature or message template, you must specify the signature scenario or template type. You must also provide the information of your services, such as a website URL, a domain name with an ICP filing, an application download URL, or the name of your WeChat official account or mini program. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. * * An SMS signature must undergo a thorough review process before it can be approved for use. * * @param request AddSmsSignRequest * @return AddSmsSignResponse */ async function addSmsSign(request: AddSmsSignRequest): AddSmsSignResponse { var runtime = new Util.RuntimeOptions{}; return addSmsSignWithOptions(request, runtime); } model AddSmsTemplateRequest { ownerId?: long(name='OwnerId'), remark?: string(name='Remark', description='The description of the message template. It is one of the reference information for template review. The description cannot exceed 100 characters in length. This parameter is required.', example='Apply for a template to send verification codes.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateContent?: string(name='TemplateContent', description='The content of the template. The content can be up to 500 characters in length. For more information, see [Message template specifications](https://help.aliyun.com/document_detail/108253.html). This parameter is required.', example='You are applying for mobile registration. The verification code is: ${code}, valid for 5 minutes!'), templateName?: string(name='TemplateName', description='The name of the template. The name can be up to 30 characters in length. This parameter is required.', example='Aliyun Test'), templateType?: int32(name='TemplateType', description='The type of the message. Valid values: * **0**: verification code * **1**: notification * **2**: promotional message * **3**: message sent to countries or regions outside the Chinese mainland > Only enterprise users can send promotional messages, or send messages to countries or regions outside the Chinese mainland. This parameter is required.', example='1'), } model AddSmsTemplateResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), templateCode?: string(name='TemplateCode', description='The code of the message template.', example='SMS_15255****'), } model AddSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: AddSmsTemplateResponseBody(name='body'), } /** * @deprecated OpenAPI AddSmsTemplate is deprecated, please use Dysmsapi::2017-05-25::CreateSmsTemplate instead. * * @summary Creates a message template. * * @description You can call the operation or use the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview) to apply for a message template. The template must comply with the [message template specifications](https://help.aliyun.com/document_detail/108253.html). You can call the [QuerySmsTemplate](https://help.aliyun.com/document_detail/419289.html) operation or use the Alibaba Cloud SMS console to check whether the message template is approved. * > * * Message templates pending approval can be withdrawn. You can withdraw a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * Message templates that have been approved can be deleted, and cannot be modified. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * If you call the AddSmsTemplate operation, you can apply for a maximum of 100 message templates in a calendar day. After you apply for a message template, we recommend that you wait for at least 30 seconds before you apply for another one. If you use the Alibaba Cloud SMS console, you can apply for an unlimited number of message templates. * * Messages sent to the Chinese mainland and messages sent to countries or regions outside the Chinese mainland use separate message templates. Create message templates based on your needs. * * If you apply for a signature or message template, you must specify the signature scenario or template type. You must also provide the information of your services, such as a website URL, a domain name with an ICP filing, an application download URL, or the name of your WeChat official account or mini program. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. * * A signature must undergo a thorough review process before it can be approved for use. For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request AddSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return AddSmsTemplateResponse */ // Deprecated async function addSmsTemplateWithOptions(request: AddSmsTemplateRequest, runtime: Util.RuntimeOptions): AddSmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateContent)) { query['TemplateContent'] = request.templateContent; } if (!Util.isUnset(request.templateName)) { query['TemplateName'] = request.templateName; } if (!Util.isUnset(request.templateType)) { query['TemplateType'] = request.templateType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'AddSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @deprecated OpenAPI AddSmsTemplate is deprecated, please use Dysmsapi::2017-05-25::CreateSmsTemplate instead. * * @summary Creates a message template. * * @description You can call the operation or use the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview) to apply for a message template. The template must comply with the [message template specifications](https://help.aliyun.com/document_detail/108253.html). You can call the [QuerySmsTemplate](https://help.aliyun.com/document_detail/419289.html) operation or use the Alibaba Cloud SMS console to check whether the message template is approved. * > * * Message templates pending approval can be withdrawn. You can withdraw a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * Message templates that have been approved can be deleted, and cannot be modified. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * If you call the AddSmsTemplate operation, you can apply for a maximum of 100 message templates in a calendar day. After you apply for a message template, we recommend that you wait for at least 30 seconds before you apply for another one. If you use the Alibaba Cloud SMS console, you can apply for an unlimited number of message templates. * * Messages sent to the Chinese mainland and messages sent to countries or regions outside the Chinese mainland use separate message templates. Create message templates based on your needs. * * If you apply for a signature or message template, you must specify the signature scenario or template type. You must also provide the information of your services, such as a website URL, a domain name with an ICP filing, an application download URL, or the name of your WeChat official account or mini program. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. * * A signature must undergo a thorough review process before it can be approved for use. For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request AddSmsTemplateRequest * @return AddSmsTemplateResponse */ // Deprecated async function addSmsTemplate(request: AddSmsTemplateRequest): AddSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return addSmsTemplateWithOptions(request, runtime); } model ChangeSignatureQualificationRequest { authorizationLetterId?: long(name='AuthorizationLetterId', description='授权委托书id', example='1000********1234'), ownerId?: long(name='OwnerId'), qualificationId?: long(name='QualificationId', description='资质id This parameter is required.', example='1*****2'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signatureName?: string(name='SignatureName', description='签名 This parameter is required.', example='示例值示例值'), } model ChangeSignatureQualificationResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: { data?: map[string]any(name='Data'), errCode?: string(name='ErrCode', example='示例值'), errMessage?: string(name='ErrMessage', example='示例值示例值'), success?: boolean(name='Success', example='true'), }(name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='0A974B78-02BF-4C79-ADF3-90CFBA1B55B1'), success?: boolean(name='Success', example='true'), } model ChangeSignatureQualificationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ChangeSignatureQualificationResponseBody(name='body'), } /** * @summary 更换签名的资质和授权书 * * @param request ChangeSignatureQualificationRequest * @param runtime runtime options for this request RuntimeOptions * @return ChangeSignatureQualificationResponse */ async function changeSignatureQualificationWithOptions(request: ChangeSignatureQualificationRequest, runtime: Util.RuntimeOptions): ChangeSignatureQualificationResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.authorizationLetterId)) { query['AuthorizationLetterId'] = request.authorizationLetterId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationId)) { query['QualificationId'] = request.qualificationId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signatureName)) { query['SignatureName'] = request.signatureName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ChangeSignatureQualification', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 更换签名的资质和授权书 * * @param request ChangeSignatureQualificationRequest * @return ChangeSignatureQualificationResponse */ async function changeSignatureQualification(request: ChangeSignatureQualificationRequest): ChangeSignatureQualificationResponse { var runtime = new Util.RuntimeOptions{}; return changeSignatureQualificationWithOptions(request, runtime); } model CheckMobilesCardSupportRequest { mobiles?: [ map[string]any ](name='Mobiles', description='The list of mobile phone numbers that receive messages. This parameter is required.'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_****'), } model CheckMobilesCardSupportResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { queryResult?: [ { mobile?: string(name='mobile', description='The mobile phone number.', example='1390000****'), support?: boolean(name='support', description='Indicates whether the mobile phone number supports card messages. * **true** * **false**', example='true'), } ](name='queryResult', description='The list of returned results.'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model CheckMobilesCardSupportResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CheckMobilesCardSupportResponseBody(name='body'), } /** * @summary Checks whether a mobile phone number can receive card messages. * * @description ### QPS limit * You can call this operation up to 2,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request CheckMobilesCardSupportRequest * @param runtime runtime options for this request RuntimeOptions * @return CheckMobilesCardSupportResponse */ async function checkMobilesCardSupportWithOptions(request: CheckMobilesCardSupportRequest, runtime: Util.RuntimeOptions): CheckMobilesCardSupportResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.mobiles)) { query['Mobiles'] = request.mobiles; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CheckMobilesCardSupport', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Checks whether a mobile phone number can receive card messages. * * @description ### QPS limit * You can call this operation up to 2,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request CheckMobilesCardSupportRequest * @return CheckMobilesCardSupportResponse */ async function checkMobilesCardSupport(request: CheckMobilesCardSupportRequest): CheckMobilesCardSupportResponse { var runtime = new Util.RuntimeOptions{}; return checkMobilesCardSupportWithOptions(request, runtime); } model ConversionDataIntlRequest { conversionRate?: string(name='ConversionRate', description='The conversion rate. > The value of this parameter is a double, and ranges from 0 to 1. This parameter is required.', example='0.53'), ownerId?: long(name='OwnerId'), reportTime?: long(name='ReportTime', description='The time point at which the conversion rate is monitored. The value is a UNIX timestamp. Unit: milliseconds. > If you do not specify this parameter, the current timestamp is used by default.', example='1349055900000'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model ConversionDataIntlResponseBody = { code?: string(name='Code', description='The status code. If OK is returned, the request is successful. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html?spm=a2c4g.101345.0.0.74326ff2J5EZyt).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8D****'), } model ConversionDataIntlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ConversionDataIntlResponseBody(name='body'), } /** * @summary Sends conversion rate information to Alibaba Cloud SMS. * * @param request ConversionDataIntlRequest * @param runtime runtime options for this request RuntimeOptions * @return ConversionDataIntlResponse */ async function conversionDataIntlWithOptions(request: ConversionDataIntlRequest, runtime: Util.RuntimeOptions): ConversionDataIntlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.conversionRate)) { query['ConversionRate'] = request.conversionRate; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.reportTime)) { query['ReportTime'] = request.reportTime; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ConversionDataIntl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Sends conversion rate information to Alibaba Cloud SMS. * * @param request ConversionDataIntlRequest * @return ConversionDataIntlResponse */ async function conversionDataIntl(request: ConversionDataIntlRequest): ConversionDataIntlResponse { var runtime = new Util.RuntimeOptions{}; return conversionDataIntlWithOptions(request, runtime); } model CreateCardSmsTemplateRequest { factorys?: string(name='Factorys', description='The mobile phone manufacturer. Valid values: * **HuaWei**: HUAWEI * **XiaoMi**: Xiaomi * **OPPO**: OPPO * **VIVO**: vivo * **MEIZU**: MEIZU > If this parameter is not specified, the system automatically specifies a supported mobile phone manufacturer.', example='XiaoMi'), memo?: string(name='Memo', description='The description of the message template.', example='Image and Text Template'), template?: map[string]any(name='Template', description='The content of the card message template. > * For information about fields such as Template, ExtendInfo, TemplateContent, TmpCard, and Action, see [Parameters of card message templates](https://help.aliyun.com/document_detail/434929.html). * Message template content varies based on the template type. For more information, see [Sample message templates](https://help.aliyun.com/document_detail/435361.html). This parameter is required.', example='{ "extendInfo":{ "scene":"HMOVM", "purpose":"2", "userExt":{ "outId":"1234554321" } }, "templateContent":{ "pages":[ { "tmpCards":[ { "type":"IMAGE", "srcType":1, "src":"28755", "actionType":"OPEN_APP", "action":{ "target":"https://s.tb.cn/c.KxzZ", "merchantName":"test-template", "packageName":[ "com.taobao.taobao"], "floorUrl":"https://s.tb.cn/c.KxzZ" }, "positionNumber":1 }, { "type":"TEXT", "content":"this is a test msg.", "isTextTitle":true, "positionNumber":2 }, { "type":"TEXT", "content":"Promotional information", "isTextTitle":false, "positionNumber":3 }, { "type":"BUTTON", "content":"Promotional information,", "actionType":"OPEN_BROWSER", "action":{ "target":"https://www.aliyun.com", "merchantName":"Currently on the Alibaba Cloud official website." }, "positionNumber":4 }] }] }, "cardSignName":"aliyun", "cardType":5 }'), templateName?: string(name='TemplateName', description='The name of the card message template. This parameter is required.', example='Aliyun Image and Text Template'), } model CreateCardSmsTemplateShrinkRequest { factorys?: string(name='Factorys', description='The mobile phone manufacturer. Valid values: * **HuaWei**: HUAWEI * **XiaoMi**: Xiaomi * **OPPO**: OPPO * **VIVO**: vivo * **MEIZU**: MEIZU > If this parameter is not specified, the system automatically specifies a supported mobile phone manufacturer.', example='XiaoMi'), memo?: string(name='Memo', description='The description of the message template.', example='Image and Text Template'), templateShrink?: string(name='Template', description='The content of the card message template. > * For information about fields such as Template, ExtendInfo, TemplateContent, TmpCard, and Action, see [Parameters of card message templates](https://help.aliyun.com/document_detail/434929.html). * Message template content varies based on the template type. For more information, see [Sample message templates](https://help.aliyun.com/document_detail/435361.html). This parameter is required.', example='{ "extendInfo":{ "scene":"HMOVM", "purpose":"2", "userExt":{ "outId":"1234554321" } }, "templateContent":{ "pages":[ { "tmpCards":[ { "type":"IMAGE", "srcType":1, "src":"28755", "actionType":"OPEN_APP", "action":{ "target":"https://s.tb.cn/c.KxzZ", "merchantName":"test-template", "packageName":[ "com.taobao.taobao"], "floorUrl":"https://s.tb.cn/c.KxzZ" }, "positionNumber":1 }, { "type":"TEXT", "content":"this is a test msg.", "isTextTitle":true, "positionNumber":2 }, { "type":"TEXT", "content":"Promotional information", "isTextTitle":false, "positionNumber":3 }, { "type":"BUTTON", "content":"Promotional information,", "actionType":"OPEN_BROWSER", "action":{ "target":"https://www.aliyun.com", "merchantName":"Currently on the Alibaba Cloud official website." }, "positionNumber":4 }] }] }, "cardSignName":"aliyun", "cardType":5 }'), templateName?: string(name='TemplateName', description='The name of the card message template. This parameter is required.', example='Aliyun Image and Text Template'), } model CreateCardSmsTemplateResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { templateCode?: string(name='TemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm?spm=5176.12818093.categories-n-products.ddysms.3b2816d0xml2NA#/overview). > Make sure that the message template has been approved.', example='CARD_SMS_60000****'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: * **true** * **false**', example='true'), } model CreateCardSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateCardSmsTemplateResponseBody(name='body'), } /** * @summary Creates a card message template. * * @description * The CreateCardSmsTemplate operation saves the card message template information, submits it to the mobile phone manufacturer for approval, and returns the message template ID. * * If the type of the message template is not supported or events that are not supported by the mobile phone manufacturer are specified, the template is not submitted. For more information, see [Supported message templates](https://help.aliyun.com/document_detail/434611.html). * * For information about sample card message templates, see [Sample card message templates](https://help.aliyun.com/document_detail/435361.html). * ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param tmpReq CreateCardSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateCardSmsTemplateResponse */ async function createCardSmsTemplateWithOptions(tmpReq: CreateCardSmsTemplateRequest, runtime: Util.RuntimeOptions): CreateCardSmsTemplateResponse { Util.validateModel(tmpReq); var request = new CreateCardSmsTemplateShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.template)) { request.templateShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.template, 'Template', 'json'); } var query = {}; if (!Util.isUnset(request.factorys)) { query['Factorys'] = request.factorys; } if (!Util.isUnset(request.memo)) { query['Memo'] = request.memo; } if (!Util.isUnset(request.templateShrink)) { query['Template'] = request.templateShrink; } if (!Util.isUnset(request.templateName)) { query['TemplateName'] = request.templateName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CreateCardSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Creates a card message template. * * @description * The CreateCardSmsTemplate operation saves the card message template information, submits it to the mobile phone manufacturer for approval, and returns the message template ID. * * If the type of the message template is not supported or events that are not supported by the mobile phone manufacturer are specified, the template is not submitted. For more information, see [Supported message templates](https://help.aliyun.com/document_detail/434611.html). * * For information about sample card message templates, see [Sample card message templates](https://help.aliyun.com/document_detail/435361.html). * ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request CreateCardSmsTemplateRequest * @return CreateCardSmsTemplateResponse */ async function createCardSmsTemplate(request: CreateCardSmsTemplateRequest): CreateCardSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return createCardSmsTemplateWithOptions(request, runtime); } model CreateSmartShortUrlRequest { outId?: string(name='OutId', example='示例值示例值'), ownerId?: long(name='OwnerId'), phoneNumbers?: string(name='PhoneNumbers', description='This parameter is required.', example='15900195***'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), sourceUrl?: string(name='SourceUrl', description='This parameter is required.', example='示例值'), } model CreateSmartShortUrlResponseBody = { code?: string(name='Code', example='示例值示例值示例值'), message?: string(name='Message', example='示例值示例值示例值'), model?: [ { domain?: string(name='Domain', example='示例值'), expiration?: long(name='Expiration', example='11'), phoneNumber?: string(name='PhoneNumber', example='示例值'), shortName?: string(name='ShortName', example='示例值'), shortUrl?: string(name='ShortUrl', example='示例值示例值'), } ](name='Model'), requestId?: string(name='RequestId', example='示例值示例值'), } model CreateSmartShortUrlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateSmartShortUrlResponseBody(name='body'), } /** * @summary 创建短链 * * @param request CreateSmartShortUrlRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateSmartShortUrlResponse */ async function createSmartShortUrlWithOptions(request: CreateSmartShortUrlRequest, runtime: Util.RuntimeOptions): CreateSmartShortUrlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.phoneNumbers)) { query['PhoneNumbers'] = request.phoneNumbers; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.sourceUrl)) { query['SourceUrl'] = request.sourceUrl; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CreateSmartShortUrl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建短链 * * @param request CreateSmartShortUrlRequest * @return CreateSmartShortUrlResponse */ async function createSmartShortUrl(request: CreateSmartShortUrlRequest): CreateSmartShortUrlResponse { var runtime = new Util.RuntimeOptions{}; return createSmartShortUrlWithOptions(request, runtime); } model CreateSmsAuthorizationLetterRequest { authorization?: string(name='Authorization', description='授权方,授权方命名长度不超过1000个字符,暂不支持包含除中点(·)、空格、中文括号【】、英文括号()外的任何符号或纯数字输入 This parameter is required.', example='阿里云有限公司'), authorizationLetterExpDate?: string(name='AuthorizationLetterExpDate', description='委托授权书有效期 This parameter is required.', example='2023-01-01~2026-01-01'), authorizationLetterName?: string(name='AuthorizationLetterName', description='委托授权书命名非空,不超过100个字符,支持中文、英文或与数字组合进行命名,暂不支持任何符号或纯数字输入 This parameter is required.', example='xxx公司授权书'), authorizationLetterPic?: string(name='AuthorizationLetterPic', description='上传oss的委托授权书图片标识 This parameter is required.'), organizationCode?: string(name='OrganizationCode', description='授权方社会统一信用代码,长度不超过150个字符 This parameter is required.', example='9****************A'), ownerId?: long(name='OwnerId'), proxyAuthorization?: string(name='ProxyAuthorization', description='被授权方,被授权方命名长度不超过1000个字符,暂不支持包含除中点(·)、空格、中文括号【】、英文括号()外的任何符号或纯数字输入 This parameter is required.', example='xxx公司'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signList?: [ string ](name='SignList', description='委托授权签名列表,签名数量限制100个以内 This parameter is required.'), } model CreateSmsAuthorizationLetterShrinkRequest { authorization?: string(name='Authorization', description='授权方,授权方命名长度不超过1000个字符,暂不支持包含除中点(·)、空格、中文括号【】、英文括号()外的任何符号或纯数字输入 This parameter is required.', example='阿里云有限公司'), authorizationLetterExpDate?: string(name='AuthorizationLetterExpDate', description='委托授权书有效期 This parameter is required.', example='2023-01-01~2026-01-01'), authorizationLetterName?: string(name='AuthorizationLetterName', description='委托授权书命名非空,不超过100个字符,支持中文、英文或与数字组合进行命名,暂不支持任何符号或纯数字输入 This parameter is required.', example='xxx公司授权书'), authorizationLetterPic?: string(name='AuthorizationLetterPic', description='上传oss的委托授权书图片标识 This parameter is required.'), organizationCode?: string(name='OrganizationCode', description='授权方社会统一信用代码,长度不超过150个字符 This parameter is required.', example='9****************A'), ownerId?: long(name='OwnerId'), proxyAuthorization?: string(name='ProxyAuthorization', description='被授权方,被授权方命名长度不超过1000个字符,暂不支持包含除中点(·)、空格、中文括号【】、英文括号()外的任何符号或纯数字输入 This parameter is required.', example='xxx公司'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signListShrink?: string(name='SignList', description='委托授权签名列表,签名数量限制100个以内 This parameter is required.'), } model CreateSmsAuthorizationLetterResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: string(name='Data', example='10000****'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), success?: boolean(name='Success', example='true'), } model CreateSmsAuthorizationLetterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateSmsAuthorizationLetterResponseBody(name='body'), } /** * @summary 创建委托授权书 * * @param tmpReq CreateSmsAuthorizationLetterRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateSmsAuthorizationLetterResponse */ async function createSmsAuthorizationLetterWithOptions(tmpReq: CreateSmsAuthorizationLetterRequest, runtime: Util.RuntimeOptions): CreateSmsAuthorizationLetterResponse { Util.validateModel(tmpReq); var request = new CreateSmsAuthorizationLetterShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.signList)) { request.signListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.signList, 'SignList', 'json'); } var query = {}; if (!Util.isUnset(request.authorization)) { query['Authorization'] = request.authorization; } if (!Util.isUnset(request.authorizationLetterExpDate)) { query['AuthorizationLetterExpDate'] = request.authorizationLetterExpDate; } if (!Util.isUnset(request.authorizationLetterName)) { query['AuthorizationLetterName'] = request.authorizationLetterName; } if (!Util.isUnset(request.authorizationLetterPic)) { query['AuthorizationLetterPic'] = request.authorizationLetterPic; } if (!Util.isUnset(request.organizationCode)) { query['OrganizationCode'] = request.organizationCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.proxyAuthorization)) { query['ProxyAuthorization'] = request.proxyAuthorization; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signListShrink)) { query['SignList'] = request.signListShrink; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CreateSmsAuthorizationLetter', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建委托授权书 * * @param request CreateSmsAuthorizationLetterRequest * @return CreateSmsAuthorizationLetterResponse */ async function createSmsAuthorizationLetter(request: CreateSmsAuthorizationLetterRequest): CreateSmsAuthorizationLetterResponse { var runtime = new Util.RuntimeOptions{}; return createSmsAuthorizationLetterWithOptions(request, runtime); } model CreateSmsSignRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, enter the domain name with HTTP or HTTPS that has been registered with the MIIT. - For launched apps, provide a display link from the app store with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, input the full name, ensuring they are online. - For e-commerce platform store names, applicable only to enterprise users, provide a display link with HTTP or HTTPS for the store.', example='http://www.aliyun.com/'), authorizationLetterId?: long(name='AuthorizationLetterId'), moreData?: [ string ](name='MoreData', description='Additional information to supplement uploaded business proof documents or screenshots, which helps reviewers understand your business details. This parameter is optional; please fill it out based on your actual needs.'), ownerId?: long(name='OwnerId'), qualificationId?: long(name='QualificationId', description='Approved or under-review qualification ID. > - Before applying for an SMS signature, please first [Apply for Qualification](https://help.aliyun.com/zh/sms/user-guide/new-qualification?spm=a2c4g.11186623.0.0.718d187bbkpMRK). > - You can view the qualification ID on the [Qualification Management](https://dysms.console.aliyun.com/domestic/text/qualification) page. This parameter is required.', example='8563**'), remark?: string(name='Remark', description='Explanation of the SMS signature scenario, with a maximum length of 200 characters. > The scenario explanation is one of the reference materials for signature review. Please provide a detailed description of the usage scenarios for your live services, along with links to verify these services such as website URLs with MIIT备案, app store display links, full names of public accounts or mini-programs, etc. For login scenarios, test account credentials are also required. A comprehensive application explanation enhances the efficiency of signature and template reviews. Refer to the **Application Scenario** column in the [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.i2#section-xup-k46-yi4) table for filling in SMS scenarios.', example='SMS signature for the login scenario using verification code.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='Signature name. Please adhere to the [Signature Specifications](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.0.4f9710fder2gR7#section-0p8-qn8-mmy). > - Signature names are case-insensitive; e.g., 【Aliyun Communication】 and 【aliyun communication】 are considered identical. > - If your verification code signature and general signature names are the same, the system defaults to using the general signature for sending SMS messages. This parameter is required.', example='Aliyun'), signSource?: int32(name='SignSource', description='Signature source. Values: - **0**: Full name or abbreviation of an enterprise or institution. - **1**: Full name or abbreviation of a MIIT-registered website. - **2**: Full name or abbreviation of an App. - **3**: Full name or abbreviation of an official account or mini-program. - **4**: Full name or abbreviation of an e-commerce platform store. - **5**: Full name or abbreviation of a trademark. For detailed information on signature sources, refer to [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.0.4f9710fder2gR7#section-xup-k46-yi4). > This interface does not support applying for signatures with sources as **Test or Learning** and **Trial Use**. If you need to apply for signatures with these sources, please go to the [SMS Service Console](https://dysms.console.aliyun.com/domestic/text/sign/add/qualification). This parameter is required.', example='1'), signType?: int32(name='SignType', description='Signature type. Values: - **0**: Verification Code - **1**: General (Default) > It is recommended to use the default value: **General**.', example='1'), thirdParty?: boolean(name='ThirdParty', description='Choose whether the applied signature is for self-use or third-party use. - false: Self-use (default) - true: Third-party use >Notice: Please select self-use qualification ID when the signature is for self-use; choose third-party use qualification ID when it\\\\"s for third-party use.', example='false'), } model CreateSmsSignShrinkRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, enter the domain name with HTTP or HTTPS that has been registered with the MIIT. - For launched apps, provide a display link from the app store with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, input the full name, ensuring they are online. - For e-commerce platform store names, applicable only to enterprise users, provide a display link with HTTP or HTTPS for the store.', example='http://www.aliyun.com/'), authorizationLetterId?: long(name='AuthorizationLetterId'), moreDataShrink?: string(name='MoreData', description='Additional information to supplement uploaded business proof documents or screenshots, which helps reviewers understand your business details. This parameter is optional; please fill it out based on your actual needs.'), ownerId?: long(name='OwnerId'), qualificationId?: long(name='QualificationId', description='Approved or under-review qualification ID. > - Before applying for an SMS signature, please first [Apply for Qualification](https://help.aliyun.com/zh/sms/user-guide/new-qualification?spm=a2c4g.11186623.0.0.718d187bbkpMRK). > - You can view the qualification ID on the [Qualification Management](https://dysms.console.aliyun.com/domestic/text/qualification) page. This parameter is required.', example='8563**'), remark?: string(name='Remark', description='Explanation of the SMS signature scenario, with a maximum length of 200 characters. > The scenario explanation is one of the reference materials for signature review. Please provide a detailed description of the usage scenarios for your live services, along with links to verify these services such as website URLs with MIIT备案, app store display links, full names of public accounts or mini-programs, etc. For login scenarios, test account credentials are also required. A comprehensive application explanation enhances the efficiency of signature and template reviews. Refer to the **Application Scenario** column in the [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.i2#section-xup-k46-yi4) table for filling in SMS scenarios.', example='SMS signature for the login scenario using verification code.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='Signature name. Please adhere to the [Signature Specifications](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.0.4f9710fder2gR7#section-0p8-qn8-mmy). > - Signature names are case-insensitive; e.g., 【Aliyun Communication】 and 【aliyun communication】 are considered identical. > - If your verification code signature and general signature names are the same, the system defaults to using the general signature for sending SMS messages. This parameter is required.', example='Aliyun'), signSource?: int32(name='SignSource', description='Signature source. Values: - **0**: Full name or abbreviation of an enterprise or institution. - **1**: Full name or abbreviation of a MIIT-registered website. - **2**: Full name or abbreviation of an App. - **3**: Full name or abbreviation of an official account or mini-program. - **4**: Full name or abbreviation of an e-commerce platform store. - **5**: Full name or abbreviation of a trademark. For detailed information on signature sources, refer to [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.0.4f9710fder2gR7#section-xup-k46-yi4). > This interface does not support applying for signatures with sources as **Test or Learning** and **Trial Use**. If you need to apply for signatures with these sources, please go to the [SMS Service Console](https://dysms.console.aliyun.com/domestic/text/sign/add/qualification). This parameter is required.', example='1'), signType?: int32(name='SignType', description='Signature type. Values: - **0**: Verification Code - **1**: General (Default) > It is recommended to use the default value: **General**.', example='1'), thirdParty?: boolean(name='ThirdParty', description='Choose whether the applied signature is for self-use or third-party use. - false: Self-use (default) - true: Third-party use >Notice: Please select self-use qualification ID when the signature is for self-use; choose third-party use qualification ID when it\\\\"s for third-party use.', example='false'), } model CreateSmsSignResponseBody = { code?: string(name='Code', description='Request status code. - OK indicates a successful request. - For other error codes, refer to the [Error Code List](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='successful'), orderId?: string(name='OrderId', description='Work order number. This parameter is used by auditors when querying the audit. You will need to provide this work order number if you require expedited review.', example='2004415****'), requestId?: string(name='RequestId', description='The ID of this call request, which is a unique identifier generated by Alibaba Cloud for the request and can be used for troubleshooting and issue localization.', example='CCA2BCFF-2BA7-427C-90EE-AC6994748607'), signName?: string(name='SignName', description='Signature name.', example='Aliyun'), } model CreateSmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateSmsSignResponseBody(name='body'), } /** * @summary Create SMS Signature * * @description - For details about the announcement of changes to the new and original interfaces, see [Announcement on Updates to SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Individual authenticated users can apply for one formal signature per natural day under the same Alibaba Cloud account, while enterprise authenticated users have no current restrictions. For details on the differences in rights between individual and enterprise users, please refer to [User Guide](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm). * - Signature information applied through the interface will be synchronized in the SMS service console. For operations related to signatures in the console, see [SMS Signatures](https://help.aliyun.com/zh/sms/user-guide/create-signatures?spm). * - After submitting the signature application, you can query the signature review status and details via the [GetSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-getsmssign?spm) interface. You can also [Configure Receipt Messages](https://help.aliyun.com/zh/sms/developer-reference/configure-delivery-receipts-1?spm) and obtain signature review status messages through SignSmsReport. * * @param tmpReq CreateSmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateSmsSignResponse */ async function createSmsSignWithOptions(tmpReq: CreateSmsSignRequest, runtime: Util.RuntimeOptions): CreateSmsSignResponse { Util.validateModel(tmpReq); var request = new CreateSmsSignShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.moreData)) { request.moreDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.moreData, 'MoreData', 'json'); } var query = {}; if (!Util.isUnset(request.applySceneContent)) { query['ApplySceneContent'] = request.applySceneContent; } if (!Util.isUnset(request.authorizationLetterId)) { query['AuthorizationLetterId'] = request.authorizationLetterId; } if (!Util.isUnset(request.moreDataShrink)) { query['MoreData'] = request.moreDataShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationId)) { query['QualificationId'] = request.qualificationId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.signSource)) { query['SignSource'] = request.signSource; } if (!Util.isUnset(request.signType)) { query['SignType'] = request.signType; } if (!Util.isUnset(request.thirdParty)) { query['ThirdParty'] = request.thirdParty; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CreateSmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create SMS Signature * * @description - For details about the announcement of changes to the new and original interfaces, see [Announcement on Updates to SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Individual authenticated users can apply for one formal signature per natural day under the same Alibaba Cloud account, while enterprise authenticated users have no current restrictions. For details on the differences in rights between individual and enterprise users, please refer to [User Guide](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm). * - Signature information applied through the interface will be synchronized in the SMS service console. For operations related to signatures in the console, see [SMS Signatures](https://help.aliyun.com/zh/sms/user-guide/create-signatures?spm). * - After submitting the signature application, you can query the signature review status and details via the [GetSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-getsmssign?spm) interface. You can also [Configure Receipt Messages](https://help.aliyun.com/zh/sms/developer-reference/configure-delivery-receipts-1?spm) and obtain signature review status messages through SignSmsReport. * * @param request CreateSmsSignRequest * @return CreateSmsSignResponse */ async function createSmsSign(request: CreateSmsSignRequest): CreateSmsSignResponse { var runtime = new Util.RuntimeOptions{}; return createSmsSignWithOptions(request, runtime); } model CreateSmsTemplateRequest { applySceneContent?: string(name='ApplySceneContent', description='If there is an applicable scenario, you can fill it in.', example='http://www.aliyun.com/'), intlType?: int32(name='IntlType', description='International/Hong Kong, Macao, and Taiwan template type. When the **TemplateType** parameter is **3**, this parameter is required for international/Hong Kong, Macao, and Taiwan templates, with values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional message.', example='0'), moreData?: [ string ](name='MoreData', description='Additional materials you can upload, such as business proof documents or screenshots, to help reviewers understand your business details. This parameter is optional; please fill it in according to actual needs.'), ownerId?: long(name='OwnerId'), relatedSignName?: string(name='RelatedSignName', description='The signature name that the template needs to be associated with. The associated SMS signature must have passed the review. This parameter is mandatory when the TemplateType parameter is **0**, **1**, or **2**. <notice>Associating a signature can expedite the review process. Note that this associated signature is unrelated to the signature selected when sending SMS messages.</notice>', example='Aliyun'), remark?: string(name='Remark', description='Please describe the business scenario where you use SMS or provide an online link to the scenario, along with a complete example of the SMS (with variable contents filled), as complete information helps increase the template approval rate. Failure to follow guidelines or leaving this field blank may affect the approval of your template.', example='Request verification code SMS.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateContent?: string(name='TemplateContent', description='Template content, up to 500 characters in length. Both the template content and variable content must comply with SMS specifications; otherwise, the template will fail the review. You can also view common template examples on the template application page. Using sample templates can enhance review efficiency and success rates. For variable specifications, see [TemplateContent Variable Parameter Filling Specifications](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example). This parameter is required.', example='You are applying for mobile registration. The verification code is: ${code}. It is valid for 5 minutes!'), templateName?: string(name='TemplateName', description='Template name, up to 30 characters in length. This parameter is required.', example='aliyunCode'), templateRule?: string(name='TemplateRule', description='Template variable rules. For filling in variable rules, refer to the [Sample Documentation](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example).', example='{"code":"characterWithNumber"}'), templateType?: int32(name='TemplateType', description='SMS type. Values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional message. - **3**: International/Hong Kong, Macao, and Taiwan messages. > Only enterprise-verified users can apply for promotional messages and international/Hong Kong, Macao, and Taiwan messages. For details on the differences between personal and enterprise user rights, please refer to [Usage Instructions](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm=a2c4g.11186623.0.0.67447f576NJnE8). This parameter is required.', example='0'), } model CreateSmsTemplateShrinkRequest { applySceneContent?: string(name='ApplySceneContent', description='If there is an applicable scenario, you can fill it in.', example='http://www.aliyun.com/'), intlType?: int32(name='IntlType', description='International/Hong Kong, Macao, and Taiwan template type. When the **TemplateType** parameter is **3**, this parameter is required for international/Hong Kong, Macao, and Taiwan templates, with values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional message.', example='0'), moreDataShrink?: string(name='MoreData', description='Additional materials you can upload, such as business proof documents or screenshots, to help reviewers understand your business details. This parameter is optional; please fill it in according to actual needs.'), ownerId?: long(name='OwnerId'), relatedSignName?: string(name='RelatedSignName', description='The signature name that the template needs to be associated with. The associated SMS signature must have passed the review. This parameter is mandatory when the TemplateType parameter is **0**, **1**, or **2**. <notice>Associating a signature can expedite the review process. Note that this associated signature is unrelated to the signature selected when sending SMS messages.</notice>', example='Aliyun'), remark?: string(name='Remark', description='Please describe the business scenario where you use SMS or provide an online link to the scenario, along with a complete example of the SMS (with variable contents filled), as complete information helps increase the template approval rate. Failure to follow guidelines or leaving this field blank may affect the approval of your template.', example='Request verification code SMS.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateContent?: string(name='TemplateContent', description='Template content, up to 500 characters in length. Both the template content and variable content must comply with SMS specifications; otherwise, the template will fail the review. You can also view common template examples on the template application page. Using sample templates can enhance review efficiency and success rates. For variable specifications, see [TemplateContent Variable Parameter Filling Specifications](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example). This parameter is required.', example='You are applying for mobile registration. The verification code is: ${code}. It is valid for 5 minutes!'), templateName?: string(name='TemplateName', description='Template name, up to 30 characters in length. This parameter is required.', example='aliyunCode'), templateRule?: string(name='TemplateRule', description='Template variable rules. For filling in variable rules, refer to the [Sample Documentation](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example).', example='{"code":"characterWithNumber"}'), templateType?: int32(name='TemplateType', description='SMS type. Values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional message. - **3**: International/Hong Kong, Macao, and Taiwan messages. > Only enterprise-verified users can apply for promotional messages and international/Hong Kong, Macao, and Taiwan messages. For details on the differences between personal and enterprise user rights, please refer to [Usage Instructions](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm=a2c4g.11186623.0.0.67447f576NJnE8). This parameter is required.', example='0'), } model CreateSmsTemplateResponseBody = { code?: string(name='Code', description='Request status code. * OK indicates a successful request. * For other error codes, refer to the **Error Codes** section of this chapter or the product\\\\"s [API Error Codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='successful'), orderId?: string(name='OrderId', description='Work order ID. This parameter is used by auditors when querying audits. If you need expedited review, you must provide this work order number.', example='2005020****'), requestId?: string(name='RequestId', description='The ID generated by Alibaba Cloud for this request, which is a unique identifier that can be used for troubleshooting and issue定位.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), templateCode?: string(name='TemplateCode', description='SMS template code. After submitting the template application, you can use the SMS template code to query the template audit details via the [GetSmsTemplate](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-getsmstemplate?) API. You can also [configure delivery receipts](https://help.aliyun.com/zh/sms/developer-reference/configure-delivery-receipts-1?spm), and obtain the template audit status messages through TemplateSmsReport.', example='SMS_10000****'), templateName?: string(name='TemplateName', description='SMS template name.', example='aliyunCode'), } model CreateSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: CreateSmsTemplateResponseBody(name='body'), } /** * @summary Create SMS Template * * @description - For details about the changes of this new interface compared to the original one, please refer to [Announcement on the Update of SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - It is recommended to apply for SMS templates via the API with at least a 30-second interval between each request. * - The template information applied through the API will be synchronized in the SMS service console. For operations related to templates in the console, please refer to SMS Templates. * - After submitting the template application, you can query the audit status and details using the GetSmsTemplate interface. You can also configure delivery receipts to obtain the audit status messages via TemplateSmsReport. * - Domestic SMS templates are not interchangeable with international/Hong Kong, Macao, and Taiwan SMS templates. Please apply for templates based on your business scenario. * - Only enterprise-verified users can apply for promotional messages and international/Hong Kong, Macao, and Taiwan messages. For differences in rights between personal and enterprise users, please refer to Usage Instructions. * * @param tmpReq CreateSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return CreateSmsTemplateResponse */ async function createSmsTemplateWithOptions(tmpReq: CreateSmsTemplateRequest, runtime: Util.RuntimeOptions): CreateSmsTemplateResponse { Util.validateModel(tmpReq); var request = new CreateSmsTemplateShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.moreData)) { request.moreDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.moreData, 'MoreData', 'json'); } var query = {}; if (!Util.isUnset(request.applySceneContent)) { query['ApplySceneContent'] = request.applySceneContent; } if (!Util.isUnset(request.intlType)) { query['IntlType'] = request.intlType; } if (!Util.isUnset(request.moreDataShrink)) { query['MoreData'] = request.moreDataShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.relatedSignName)) { query['RelatedSignName'] = request.relatedSignName; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateContent)) { query['TemplateContent'] = request.templateContent; } if (!Util.isUnset(request.templateName)) { query['TemplateName'] = request.templateName; } if (!Util.isUnset(request.templateRule)) { query['TemplateRule'] = request.templateRule; } if (!Util.isUnset(request.templateType)) { query['TemplateType'] = request.templateType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'CreateSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Create SMS Template * * @description - For details about the changes of this new interface compared to the original one, please refer to [Announcement on the Update of SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - It is recommended to apply for SMS templates via the API with at least a 30-second interval between each request. * - The template information applied through the API will be synchronized in the SMS service console. For operations related to templates in the console, please refer to SMS Templates. * - After submitting the template application, you can query the audit status and details using the GetSmsTemplate interface. You can also configure delivery receipts to obtain the audit status messages via TemplateSmsReport. * - Domestic SMS templates are not interchangeable with international/Hong Kong, Macao, and Taiwan SMS templates. Please apply for templates based on your business scenario. * - Only enterprise-verified users can apply for promotional messages and international/Hong Kong, Macao, and Taiwan messages. For differences in rights between personal and enterprise users, please refer to Usage Instructions. * * @param request CreateSmsTemplateRequest * @return CreateSmsTemplateResponse */ async function createSmsTemplate(request: CreateSmsTemplateRequest): CreateSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return createSmsTemplateWithOptions(request, runtime); } model DeleteExtCodeSignRequest { extCode?: string(name='ExtCode', description='扩展码A3 This parameter is required.', example='01'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名 This parameter is required.', example='示例值'), } model DeleteExtCodeSignResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: boolean(name='Data', example='false'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model DeleteExtCodeSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteExtCodeSignResponseBody(name='body'), } /** * @summary 删除验证码签名 * * @param request DeleteExtCodeSignRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteExtCodeSignResponse */ async function deleteExtCodeSignWithOptions(request: DeleteExtCodeSignRequest, runtime: Util.RuntimeOptions): DeleteExtCodeSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.extCode)) { query['ExtCode'] = request.extCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'DeleteExtCodeSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除验证码签名 * * @param request DeleteExtCodeSignRequest * @return DeleteExtCodeSignResponse */ async function deleteExtCodeSign(request: DeleteExtCodeSignRequest): DeleteExtCodeSignResponse { var runtime = new Util.RuntimeOptions{}; return deleteExtCodeSignWithOptions(request, runtime); } model DeleteShortUrlRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), sourceUrl?: string(name='SourceUrl', description='The source address. The address can be up to 1,000 characters in length. This parameter is required.', example='https://www.****.com/product/sms'), } model DeleteShortUrlResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), } model DeleteShortUrlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteShortUrlResponseBody(name='body'), } /** * @summary Deletes a short URL. After you delete a short URL, it cannot be changed to its original state. * * @description ### QPS limits * You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteShortUrlRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteShortUrlResponse */ async function deleteShortUrlWithOptions(request: DeleteShortUrlRequest, runtime: Util.RuntimeOptions): DeleteShortUrlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var body : map[string]any = {}; if (!Util.isUnset(request.sourceUrl)) { body['SourceUrl'] = request.sourceUrl; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'DeleteShortUrl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Deletes a short URL. After you delete a short URL, it cannot be changed to its original state. * * @description ### QPS limits * You can call this operation up to 100 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteShortUrlRequest * @return DeleteShortUrlResponse */ async function deleteShortUrl(request: DeleteShortUrlRequest): DeleteShortUrlResponse { var runtime = new Util.RuntimeOptions{}; return deleteShortUrlWithOptions(request, runtime); } model DeleteSmsQualificationRequest { orderId?: long(name='OrderId', description='工单ID This parameter is required.', example='2001****'), ownerId?: long(name='OwnerId'), qualificationGroupId?: long(name='QualificationGroupId', description='资质组ID This parameter is required.', example='10000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model DeleteSmsQualificationResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: boolean(name='Data', example='true'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model DeleteSmsQualificationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteSmsQualificationResponseBody(name='body'), } /** * @summary 删除资质对客openAPI * * @param request DeleteSmsQualificationRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteSmsQualificationResponse */ async function deleteSmsQualificationWithOptions(request: DeleteSmsQualificationRequest, runtime: Util.RuntimeOptions): DeleteSmsQualificationResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.orderId)) { query['OrderId'] = request.orderId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationGroupId)) { query['QualificationGroupId'] = request.qualificationGroupId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'DeleteSmsQualification', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 删除资质对客openAPI * * @param request DeleteSmsQualificationRequest * @return DeleteSmsQualificationResponse */ async function deleteSmsQualification(request: DeleteSmsQualificationRequest): DeleteSmsQualificationResponse { var runtime = new Util.RuntimeOptions{}; return deleteSmsQualificationWithOptions(request, runtime); } model DeleteSmsSignRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='The signature. > The signature must be submitted by the current Alibaba Cloud account, and has been approved. This parameter is required.', example='Aliyun'), } model DeleteSmsSignResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8D****'), signName?: string(name='SignName', description='The signature.', example='Aliyun'), } model DeleteSmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteSmsSignResponseBody(name='body'), } /** * @summary Deletes a signature. * * @description * You cannot delete a signature that has not been approved. * * After you delete a signature, you cannot recover it. Proceed with caution. * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteSmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteSmsSignResponse */ async function deleteSmsSignWithOptions(request: DeleteSmsSignRequest, runtime: Util.RuntimeOptions): DeleteSmsSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'DeleteSmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Deletes a signature. * * @description * You cannot delete a signature that has not been approved. * * After you delete a signature, you cannot recover it. Proceed with caution. * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteSmsSignRequest * @return DeleteSmsSignResponse */ async function deleteSmsSign(request: DeleteSmsSignRequest): DeleteSmsSignResponse { var runtime = new Util.RuntimeOptions{}; return deleteSmsSignWithOptions(request, runtime); } model DeleteSmsTemplateRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm) and obtain the message template code on the **Message Templates** tab. You can also obtain the message template code by calling the [AddSmsTemplate](https://help.aliyun.com/document_detail/121208.html) operation. This parameter is required.', example='SMS_152550****'), } model DeleteSmsTemplateResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='CCA2BCFF-2BA7-427C-90EE-AC6994748607'), templateCode?: string(name='TemplateCode', description='The code of the message template.', example='SMS_20375****'), } model DeleteSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: DeleteSmsTemplateResponseBody(name='body'), } /** * @summary Deletes a message template. * * @description * Message templates pending approval can be withdrawn. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * Message templates that have been approved can be deleted, and cannot be modified. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * You cannot recover deleted message templates. Proceed with caution. * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return DeleteSmsTemplateResponse */ async function deleteSmsTemplateWithOptions(request: DeleteSmsTemplateRequest, runtime: Util.RuntimeOptions): DeleteSmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'DeleteSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Deletes a message template. * * @description * Message templates pending approval can be withdrawn. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * Message templates that have been approved can be deleted, and cannot be modified. You can delete a message template pending approval on the Message Templates tab in the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). * * You cannot recover deleted message templates. Proceed with caution. * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request DeleteSmsTemplateRequest * @return DeleteSmsTemplateResponse */ async function deleteSmsTemplate(request: DeleteSmsTemplateRequest): DeleteSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return deleteSmsTemplateWithOptions(request, runtime); } model GetCardSmsDetailsRequest { bizCardId?: string(name='BizCardId', description='Card SMS sending ID, which is the BizCardId field in the response when calling SendCardSms or SendBatchCardSms.', example='123456^0'), bizDigitId?: string(name='BizDigitId', description='Digital SMS sending ID, which is the BizDigitalId field in the response when calling SendCardSms or SendBatchCardSms.', example='12346^0'), bizSmsId?: string(name='BizSmsId', description='Text SMS sending ID, which is the BizSmsId field in the response when calling SendCardSms or SendBatchCardSms.', example='1234576^0'), currentPage?: long(name='CurrentPage', description='For paginated viewing of sending records, specify the current page number of the sending records.', example='1'), ownerId?: long(name='OwnerId'), pageSize?: long(name='PageSize', description='For paginated viewing of sending records, specify the number of card SMS records to display per page. The value range is 1~50.', example='10'), phoneNumber?: string(name='PhoneNumber', description='Domestic phone number that received the SMS. Format: 11-digit phone number, for example, 1390000****. This parameter is required.', example='1390000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), sendDate?: string(name='SendDate', description='Card SMS sending date, supports querying records from the last 30 days. Format: yyyyMMdd, for example, 20240112. This parameter is required.', example='20240112'), } model GetCardSmsDetailsResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail', description='Access denied detail; this field is returned only if the RAM check fails.', example='无'), cardSendDetailDTO?: { currentPage?: long(name='CurrentPage', description='Current page number', example='1'), pageSize?: long(name='PageSize', description='Page size', example='10'), records?: [ { errCode?: string(name='ErrCode', description='Error code for sending', example='Success'), outId?: string(name='OutId', description='Customer-transmitted outId', example='12345678'), phoneNumber?: string(name='PhoneNumber', description='Phone number that received the SMS', example='156****9080'), receiveDate?: string(name='ReceiveDate', description='Receive date', example='2024-09-27 11:26:35'), receiveType?: string(name='ReceiveType', description='Receive SMS type', example='CARD_SMS'), renderDate?: string(name='RenderDate', description='Render date', example='2024-09-27 12:13:39'), renderStatus?: long(name='RenderStatus', description='Render status. 0: Not rendered; 1: Rendered successfully; 3: Not rendered', example='1'), sendDate?: string(name='SendDate', description='Time when the SMS was sent', example='2024-09-27 11:26:32'), sendStatus?: long(name='SendStatus', description='Sending status. 1: Sending; 2: Send failed; 3: Sent successfully; 4: Addressing failed', example='3'), smsContent?: string(name='SmsContent', description='SMS content. Only applicable for text messages.', example='您收到一条短信消息'), templateCode?: string(name='TemplateCode', description='Template code', example='CARD_SMS_6***'), } ](name='Records', description='List of card SMS sending records'), totalCount?: long(name='TotalCount', description='Total count', example='10'), }(name='CardSendDetailDTO', description='Card SMS sending result'), code?: string(name='Code', description='Request status code. * OK indicates a successful request. * For other error codes, see [API Error Codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='OK'), success?: boolean(name='Success', description='Indicates whether the API call was successful. Values: - **true** - **false**', example='true'), } model GetCardSmsDetailsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetCardSmsDetailsResponseBody(name='body'), } /** * @summary Query card sending details * * @param request GetCardSmsDetailsRequest * @param runtime runtime options for this request RuntimeOptions * @return GetCardSmsDetailsResponse */ async function getCardSmsDetailsWithOptions(request: GetCardSmsDetailsRequest, runtime: Util.RuntimeOptions): GetCardSmsDetailsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.bizCardId)) { query['BizCardId'] = request.bizCardId; } if (!Util.isUnset(request.bizDigitId)) { query['BizDigitId'] = request.bizDigitId; } if (!Util.isUnset(request.bizSmsId)) { query['BizSmsId'] = request.bizSmsId; } if (!Util.isUnset(request.currentPage)) { query['CurrentPage'] = request.currentPage; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.phoneNumber)) { query['PhoneNumber'] = request.phoneNumber; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.sendDate)) { query['SendDate'] = request.sendDate; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetCardSmsDetails', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query card sending details * * @param request GetCardSmsDetailsRequest * @return GetCardSmsDetailsResponse */ async function getCardSmsDetails(request: GetCardSmsDetailsRequest): GetCardSmsDetailsResponse { var runtime = new Util.RuntimeOptions{}; return getCardSmsDetailsWithOptions(request, runtime); } model GetCardSmsLinkRequest { cardCodeType?: int32(name='CardCodeType', description='The code type of the URLs. * **1**: group texting * **2**: personalization', example='2'), cardLinkType?: int32(name='CardLinkType', description='The type of the short URLs. * 1: standard short code. * 2: custom short code. > If the **CardLinkType** is not specified, standard short codes are generated. If you need to generate custom short codes, contact Alibaba Cloud SMS technical support.', example='1'), cardTemplateCode?: string(name='CardTemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_****'), cardTemplateParamJson?: string(name='CardTemplateParamJson', description='The variables of the message template.', example='[{},{}]'), customShortCodeJson?: string(name='CustomShortCodeJson', description='The custom short code. It can contain 4 to 8 digits or letters. > If the CardLinkType parameter is set to 2, the CustomShortCodeJson parameter is required.', example='abCde'), domain?: string(name='Domain', description='The original domain name. You must submit domain names for approval in advance. > * If the **CardLinkType** parameter is set to **2**, the **Domain** parameter is required. * The **Domain** parameter cannot exceed 100 characters in length. If the parameter is not specified, a default domain name is used.', example='xxx.com'), outId?: string(name='OutId', description='The extension field.', example='BC20220608102511660860762****'), phoneNumberJson?: string(name='PhoneNumberJson', description='The mobile phone numbers of recipients, custom identifiers, or system identifiers. > * A maximum of 10,000 mobile phone numbers are supported. * You can enter custom identifier. Each identifier can be a maximum of 60 characters in length. * You can apply for a maximum of 10 OPPO templates at a time.', example='[\\\\"1390000**** \\\\",\\\\"1370000**** \\\\"]'), signNameJson?: string(name='SignNameJson', description='The signature. You can view the template code in the **Signature** column on the **Signaturess** tab of the **Go China** page in the Alibaba Cloud SMS console. > The signatures must be approved and correspond to the mobile numbers in sequence. This parameter is required.', example='[\\\\"aliyun\\\\", \\\\"aliyun2\\\\"]'), } model GetCardSmsLinkResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { cardPhoneNumbers?: string(name='CardPhoneNumbers', description='The mobile phone numbers that support card messages.', example='[\\\\"1390000****\\\\",\\\\"1370000****\\\\"]'), cardSignNames?: string(name='CardSignNames', description='The signatures must correspond to the mobile numbers and short URLs in sequence.', example='["aliyun","aliyun2"]'), cardSmsLinks?: string(name='CardSmsLinks', description='The short URLs.', example='[\\\\"mw2m.cn/LAaGGa\\\\",\\\\"mw2m.cn/LAAaes\\\\"]'), cardTmpState?: int32(name='CardTmpState', description='The review status of the card message template. * **0**: pending approval * **1**: approved * **2**: rejected > Unapproved card messages are rolled back.', example='0'), notMediaMobiles?: string(name='NotMediaMobiles', description='The mobile phone numbers that do not support card messages.', example='1390000****'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='CC89A90C-978F-46AC-B80D-54738371E7CA'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model GetCardSmsLinkResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetCardSmsLinkResponseBody(name='body'), } /** * @summary Queries the short URLs of a card messages template. * * @description ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request GetCardSmsLinkRequest * @param runtime runtime options for this request RuntimeOptions * @return GetCardSmsLinkResponse */ async function getCardSmsLinkWithOptions(request: GetCardSmsLinkRequest, runtime: Util.RuntimeOptions): GetCardSmsLinkResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.cardCodeType)) { query['CardCodeType'] = request.cardCodeType; } if (!Util.isUnset(request.cardLinkType)) { query['CardLinkType'] = request.cardLinkType; } if (!Util.isUnset(request.cardTemplateCode)) { query['CardTemplateCode'] = request.cardTemplateCode; } if (!Util.isUnset(request.cardTemplateParamJson)) { query['CardTemplateParamJson'] = request.cardTemplateParamJson; } if (!Util.isUnset(request.customShortCodeJson)) { query['CustomShortCodeJson'] = request.customShortCodeJson; } if (!Util.isUnset(request.domain)) { query['Domain'] = request.domain; } if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.phoneNumberJson)) { query['PhoneNumberJson'] = request.phoneNumberJson; } if (!Util.isUnset(request.signNameJson)) { query['SignNameJson'] = request.signNameJson; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetCardSmsLink', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the short URLs of a card messages template. * * @description ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request GetCardSmsLinkRequest * @return GetCardSmsLinkResponse */ async function getCardSmsLink(request: GetCardSmsLinkRequest): GetCardSmsLinkResponse { var runtime = new Util.RuntimeOptions{}; return getCardSmsLinkWithOptions(request, runtime); } model GetMediaResourceIdRequest { extendInfo?: string(name='ExtendInfo', description='The extended fields. > If you set the ResourceType parameter to **2**, this parameter is required.', example='{\\\\"img_rate\\\\":\\\\"oneToOne\\\\"}'), fileSize?: long(name='FileSize', description='The size of the resource. Unit: bytes. This parameter is required.', example='12'), memo?: string(name='Memo', description='The description of the resource.', example='remark'), ossKey?: string(name='OssKey', description='The address of the resource. This parameter is required.', example='oss://alicom-fc-media/1947741454322274/alicom-fc-media/pic/202205191526575398603697152.png'), resourceType?: int32(name='ResourceType', description='The type of the resource. * **1**: text. * **2**: image. A small image cannot exceed 100 KB in size, and a large image cannot exceed 2 MB in size. The image must be clear. Supported format: JPG, JPEG, and PNG. * **3**: audio. * **4**: video. Supported format: MP4. > * If you set the ResourceType parameter to 2, the **img_rate** required is required. Valid values: * 1:1 * 16:9 * 3:1 * 48:65 This parameter is required.', example='1'), } model GetMediaResourceIdResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { resUrlDownload?: string(name='ResUrlDownload', description='The download URL of the resource.', example='http://test-example.com/download.jpg'), resourceId?: long(name='ResourceId', description='The resource ID.', example='SMS_14571****'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='F07CF237-F6E3-5F77-B91B-F9B7C5DE84AB'), success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: * **true** * **false**', example='true'), } model GetMediaResourceIdResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetMediaResourceIdResponseBody(name='body'), } /** * @summary Converts a resource uploaded to the specified Object Storage Service (OSS) bucket for unified management. Then, a resource ID is returned. You can manage the resource based on the ID. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request GetMediaResourceIdRequest * @param runtime runtime options for this request RuntimeOptions * @return GetMediaResourceIdResponse */ async function getMediaResourceIdWithOptions(request: GetMediaResourceIdRequest, runtime: Util.RuntimeOptions): GetMediaResourceIdResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.extendInfo)) { query['ExtendInfo'] = request.extendInfo; } if (!Util.isUnset(request.fileSize)) { query['FileSize'] = request.fileSize; } if (!Util.isUnset(request.memo)) { query['Memo'] = request.memo; } if (!Util.isUnset(request.ossKey)) { query['OssKey'] = request.ossKey; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetMediaResourceId', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Converts a resource uploaded to the specified Object Storage Service (OSS) bucket for unified management. Then, a resource ID is returned. You can manage the resource based on the ID. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request GetMediaResourceIdRequest * @return GetMediaResourceIdResponse */ async function getMediaResourceId(request: GetMediaResourceIdRequest): GetMediaResourceIdResponse { var runtime = new Util.RuntimeOptions{}; return getMediaResourceIdWithOptions(request, runtime); } model GetOSSInfoForCardTemplateResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { accessKeyId?: string(name='AccessKeyId', description='The AccessKey ID.', example='LTAIxetqt1Dg****'), aliUid?: string(name='AliUid', description='The ID of the Alibaba Cloud account.', example='599333677478****'), bucket?: string(name='Bucket', description='The name of the OSS bucket.', example='alicom-cardsms-resources'), expireTime?: string(name='ExpireTime', description='The timeout period.', example='1634209418'), host?: string(name='Host', description='The hostname.', example='https://alicom-cardsms-resources.oss-cn-zhangjiakou.aliyuncs.com'), policy?: string(name='Policy', description='The signature policy.', example='eyJxxx0='), signature?: string(name='Signature', description='The signature.', example='Aliyun'), startPath?: string(name='StartPath', description='The path of the policy.', example='1631792777'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model GetOSSInfoForCardTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetOSSInfoForCardTemplateResponseBody(name='body'), } /** * @summary Queries the OSS configuration information about card messages. * * @description Resources such as images and videos used for card message templates can be uploaded to Object Storage Service (OSS) buckets for storage. For more information, see [Upload files to OSS](https://help.aliyun.com/document_detail/437303.html). * ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request GetOSSInfoForCardTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return GetOSSInfoForCardTemplateResponse */ async function getOSSInfoForCardTemplateWithOptions(runtime: Util.RuntimeOptions): GetOSSInfoForCardTemplateResponse { var req = new OpenApi.OpenApiRequest{}; var params = new OpenApi.Params{ action = 'GetOSSInfoForCardTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the OSS configuration information about card messages. * * @description Resources such as images and videos used for card message templates can be uploaded to Object Storage Service (OSS) buckets for storage. For more information, see [Upload files to OSS](https://help.aliyun.com/document_detail/437303.html). * ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @return GetOSSInfoForCardTemplateResponse */ async function getOSSInfoForCardTemplate(): GetOSSInfoForCardTemplateResponse { var runtime = new Util.RuntimeOptions{}; return getOSSInfoForCardTemplateWithOptions(runtime); } model GetOSSInfoForUploadFileRequest { bizType?: string(name='BizType', description='Business type, default value is **fcMediaSms**. When creating signatures and templates, and uploading **additional materials**, this value is **fcMediaSms**.', example='fcMediaSms'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model GetOSSInfoForUploadFileResponseBody = { code?: string(name='Code', description='Request status code. - OK return represents a successful request. - For other error codes, please refer to the [Error Code List](https://help.aliyun.com/document_detail/101346.htm).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='OK'), model?: { accessKeyId?: string(name='AccessKeyId', description='AccessKey ID used for signing.', example='LTAIxetqt1Dg****'), expireTime?: string(name='ExpireTime', description='Expiration time.', example='1719297445'), host?: string(name='Host', description='Host address.', example='https://alicom-fc-media.oss-cn-zhangjiakou.aliyuncs.com'), policy?: string(name='Policy', description='Signature policy.', example='eyJleHBpcmF0aW9uIjoiMjAyN***Ni0yNVQwNjozNzoyNS45NzBaI**iY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0sWyJzdGFydHMtd2l0***sIiRrZXkiLCIiXV19'), signature?: string(name='Signature', description='Signature information calculated based on **AccessKey Secret** and **Policy**. When calling the OSS API, OSS verifies this signature information to confirm the legitimacy of the Post request.', example='BXnwCWPrhVb*****aoZHZfli5KE='), startPath?: string(name='StartPath', description='Policy path.', example='123456'), }(name='Model', description='Return result.'), requestId?: string(name='RequestId', description='The ID of this call request, which is a unique identifier generated by Alibaba Cloud for the request, can be used for troubleshooting and issue定位.', example='A90E4451-FED7-49D2-87C8-00700EDCFD0D'), success?: boolean(name='Success', description='Indicates success. Values: - **true** - **false**', example='true'), } model GetOSSInfoForUploadFileResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetOSSInfoForUploadFileResponseBody(name='body'), } /** * @summary SMS File Upload, Get Authorization Info * * @description - When creating signatures or templates, you can upload materials such as login pages with links, backend page screenshots, software copyrights, supplementary agreements, etc. This helps the review personnel understand your business details. If there are multiple materials, they can be combined into one file, supporting png, jpg, jpeg, doc, docx, pdf formats. * - For additional materials needed when creating signatures or templates, you can upload them to the OSS file system for storage. For file upload operations, refer to [OSS File Upload](https://help.aliyun.com/zh/sms/upload-files-through-oss). * * @param request GetOSSInfoForUploadFileRequest * @param runtime runtime options for this request RuntimeOptions * @return GetOSSInfoForUploadFileResponse */ async function getOSSInfoForUploadFileWithOptions(request: GetOSSInfoForUploadFileRequest, runtime: Util.RuntimeOptions): GetOSSInfoForUploadFileResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.bizType)) { query['BizType'] = request.bizType; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetOSSInfoForUploadFile', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary SMS File Upload, Get Authorization Info * * @description - When creating signatures or templates, you can upload materials such as login pages with links, backend page screenshots, software copyrights, supplementary agreements, etc. This helps the review personnel understand your business details. If there are multiple materials, they can be combined into one file, supporting png, jpg, jpeg, doc, docx, pdf formats. * - For additional materials needed when creating signatures or templates, you can upload them to the OSS file system for storage. For file upload operations, refer to [OSS File Upload](https://help.aliyun.com/zh/sms/upload-files-through-oss). * * @param request GetOSSInfoForUploadFileRequest * @return GetOSSInfoForUploadFileResponse */ async function getOSSInfoForUploadFile(request: GetOSSInfoForUploadFileRequest): GetOSSInfoForUploadFileResponse { var runtime = new Util.RuntimeOptions{}; return getOSSInfoForUploadFileWithOptions(request, runtime); } model GetQualificationOssInfoRequest { bizType?: string(name='BizType', description='业务,非空 This parameter is required.', example='dysms'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model GetQualificationOssInfoResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: { accessKeyId?: string(name='AccessKeyId', description='ak', example='bypFNbG******'), expire?: long(name='Expire', description='过期时间', example='1741521339'), host?: string(name='Host', description='域名', example='http://***.oss-cn-zhangjiakou.aliyuncs.com'), policy?: string(name='Policy', description='策略', example='eyJleHBpcmF0aW9uIjoiMjAyNS0wMy0wOVQxMTo1NTozOS4wMDFaIiwiY29uZGl0aW9ucyI6W1siY29udGVudC1sZW5ndGgtcmFuZ2UiLDAsMTA0ODU3NjAwMF0seyJidWNrZXQiOiJhbGljb20tZmMtbWVkaWEifSxbImVxIiwiJGtleSIsIjEwMDAwMDM1ODA4MjA2M1wv********'), signature?: string(name='Signature', description='签名', example='QvNTGC9DSLTeByP+ZWW******'), startPath?: string(name='StartPath', description='前缀', example='1000********001'), }(name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model GetQualificationOssInfoResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetQualificationOssInfoResponseBody(name='body'), } /** * @summary 上传文件获取oss配置 * * @param request GetQualificationOssInfoRequest * @param runtime runtime options for this request RuntimeOptions * @return GetQualificationOssInfoResponse */ async function getQualificationOssInfoWithOptions(request: GetQualificationOssInfoRequest, runtime: Util.RuntimeOptions): GetQualificationOssInfoResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.bizType)) { query['BizType'] = request.bizType; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetQualificationOssInfo', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 上传文件获取oss配置 * * @param request GetQualificationOssInfoRequest * @return GetQualificationOssInfoResponse */ async function getQualificationOssInfo(request: GetQualificationOssInfoRequest): GetQualificationOssInfoResponse { var runtime = new Util.RuntimeOptions{}; return getQualificationOssInfoWithOptions(request, runtime); } model GetSmsSignRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='Signature name. Must be an SMS signature already applied for by this account. - Obtain from the return parameters after calling the [CreateSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-createsmssign?spm) API. - View the signature on the [Signature Management](https://dysms.console.aliyun.com/domestic/text/sign) page. This parameter is required.', example='Aliyun'), } model GetSmsSignResponseBody = { applyScene?: string(name='ApplyScene', description='Content of application scenarios.', example='http://www.aliyun.com/'), auditInfo?: { auditDate?: string(name='AuditDate', description='Audit date and time.', example='2024-06-03 12:02:34'), rejectInfo?: string(name='RejectInfo', description='Reasons for not passing the review.', example='reason for rejection.'), }(name='AuditInfo', description='Audit information.'), authorizationLetterAuditPass?: boolean(name='AuthorizationLetterAuditPass'), authorizationLetterId?: long(name='AuthorizationLetterId'), code?: string(name='Code', description='Request status code. - OK indicates a successful request. - For other error codes, see [API Error Codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), createDate?: string(name='CreateDate', description='Creation date and time of the SMS signature.', example='2024-06-03 10:02:34'), fileUrlList?: [ string ](name='FileUrlList', description='更多资料信息,补充上传业务证明文件或业务截图文件列表。'), message?: string(name='Message', description='Description of the status code.', example='OK'), orderId?: string(name='OrderId', description='Work order number. Used by reviewers when querying the review. You need to provide this work order number if you require expedited review.', example='20044156924'), qualificationId?: long(name='QualificationId', description='Credential ID, the credential ID associated when applying for the signature.', example='2004393****'), registerResult?: int32(name='RegisterResult'), remark?: string(name='Remark', description='Explanation of the SMS signature scenario, with a maximum length of 200 characters.', example='Send verification code text message during login.'), requestId?: string(name='RequestId', description='The ID of this call request, which is a unique identifier generated by Alibaba Cloud for the request and can be used for troubleshooting and issue localization.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), signCode?: string(name='SignCode', description='SMS signature code.', example='SIGN_100000077042023_17174665*****_ZM2kG'), signName?: string(name='SignName', description='SMS signature name.', example='Aliyun'), signStatus?: long(name='SignStatus', description='Signature review status. Values: - **0**: Under review. - **1**: Approved. - **2**: Review failed, please check the Reason parameter for the failure cause. - **10**: Review canceled.', example='2'), signTag?: string(name='SignTag', description='Signature tag indicating whether the signature is user-defined, system-provided, test, or trial. Values: - 2: User-defined signature - 3: System-provided signature - 4: Test signature - 5: Trial signature', example='2'), signUsage?: string(name='SignUsage', description='scenarios for using signatures.', example='App.'), thirdParty?: boolean(name='ThirdParty', description='Signature usage indication—self-use or third-party use. - false: Self-use (default) - true: Third-party use', example='false'), } model GetSmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetSmsSignResponseBody(name='body'), } /** * @summary Query SMS Signature Details * * @description - For details about the changes of this new interface and the original one, please refer to [Announcement on the Update of SMS Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Review Time: Generally, after submitting the signature, Alibaba Cloud expects to complete the review within 2 hours (Review Business Hours: Monday to Sunday 9:00~21:00, with legal holidays postponed). It is recommended to submit your application before 18:00. * - If the signature fails the review, the reason for the failure will be returned. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm), invoke the [UpdateSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-updatesmssign?spm) API, or modify the unapproved SMS signature on the [Signature Management](https://dysms.console.aliyun.com/domestic/text/sign) page. * * @param request GetSmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return GetSmsSignResponse */ async function getSmsSignWithOptions(request: GetSmsSignRequest, runtime: Util.RuntimeOptions): GetSmsSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetSmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query SMS Signature Details * * @description - For details about the changes of this new interface and the original one, please refer to [Announcement on the Update of SMS Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Review Time: Generally, after submitting the signature, Alibaba Cloud expects to complete the review within 2 hours (Review Business Hours: Monday to Sunday 9:00~21:00, with legal holidays postponed). It is recommended to submit your application before 18:00. * - If the signature fails the review, the reason for the failure will be returned. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm), invoke the [UpdateSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-updatesmssign?spm) API, or modify the unapproved SMS signature on the [Signature Management](https://dysms.console.aliyun.com/domestic/text/sign) page. * * @param request GetSmsSignRequest * @return GetSmsSignResponse */ async function getSmsSign(request: GetSmsSignRequest): GetSmsSignResponse { var runtime = new Util.RuntimeOptions{}; return getSmsSignWithOptions(request, runtime); } model GetSmsTemplateRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='SMS template code. - Obtain the SMS template code from the return parameters of the [CreateSmsTemplate](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-createsmstemplate?spm) API. - View the SMS template code on the [Template Management](https://dysms.console.aliyun.com/domestic/text/template) page. This parameter is required.', example='SMS_20375****'), } model GetSmsTemplateResponseBody = { applyScene?: string(name='ApplyScene', description='Application scenario content.', example='http://www.aliyun.com/'), auditInfo?: { auditDate?: string(name='AuditDate', description='Audit date and time.', example='2024-06-03 11:20:34'), rejectInfo?: string(name='RejectInfo', description='Reasons for failed audit.', example='模板内容中包含错别字。'), }(name='AuditInfo', description='Audit information.'), code?: string(name='Code', description='Request status code. * OK indicates a successful request. * For other error codes, please refer to [API Error Codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), createDate?: string(name='CreateDate', description='The time when the SMS template was created.', example='2024-06-03 10:02:34'), fileUrlList?: { fileUrl?: [ string ](name='FileUrl') }(name='FileUrlList', description='File information, compatible with signatures created by the [AddSmsSign](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-addsmstemplate?spm) API.'), intlType?: int32(name='IntlType', description='International/Hong Kong, Macao, and Taiwan template type. When the **TemplateType** parameter is **3**, this parameter is required for international/Hong Kong, Macao, and Taiwan templates, with values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS.', example='0'), message?: string(name='Message', description='Description of the status code.', example='OK'), moreDataFileUrlList?: { moreDataFileUrl?: [ string ](name='MoreDataFileUrl') }(name='MoreDataFileUrlList', description='Additional documentation information, supplementing uploaded business proof files or operational screenshots file list.'), orderId?: string(name='OrderId', description='Work order number. This parameter is used by auditors when querying the audit. You need to provide this work order number when requesting expedited review.', example='2003019****'), relatedSignName?: string(name='RelatedSignName', description='The SMS signature associated with the template when applied.', example='阿里云'), remark?: string(name='Remark', description='Explanation for the SMS template application, which is one of the reference information for template review.', example='申请验证码模板'), requestId?: string(name='RequestId', description='The ID of this call request, which is a unique identifier generated by Alibaba Cloud for the request and can be used for troubleshooting and issue定位.', example='819BE656-D2E0-4858-8B21-B2E47708****'), templateCode?: string(name='TemplateCode', description='SMS template code.', example='SMS_20375****'), templateContent?: string(name='TemplateContent', description='Content of the SMS template.', example='您正在申请手机注册,验证码为:${code},5分钟内有效!'), templateName?: string(name='TemplateName', description='Name of the SMS template.', example='验证码'), templateStatus?: string(name='TemplateStatus', description='Template review status. Return values: - **0**: Under review. - **1**: Approved. - **2**: Not approved, with reasons for failure returned. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm=a2c4g.11186623.0.0.41fd339f3bPSCQ), invoke the [UpdateSmsTemplate](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-updatesmstemplate?spm) API or modify the SMS template on the [Template Management](https://dysms.console.aliyun.com/domestic/text/template) page. - **10**: Review canceled.', example='2'), templateTag?: int32(name='TemplateTag', description='Template identifier, indicating whether the template is user-defined or system-provided. Values: - **2**: User-defined template. - **3**: System-provided template.', example='2'), templateType?: string(name='TemplateType', description='SMS type. Values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS. - **3**: International/Hong Kong, Macao, and Taiwan messages. > Only enterprise-certified users can apply for promotional SMS and international/Hong Kong, Macao, and Taiwan messages. For details on the differences between personal and enterprise user rights, please refer to [Usage Notes](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm=a2c4g.11186623.0.0.67447f576NJnE8).', example='0'), variableAttribute?: string(name='VariableAttribute', description='Template variable rules. For detailed rules of template variables, refer to the [Example Document](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example).', example='{"code":"characterWithNumber"}'), vendorAuditStatus?: map[string]any(name='VendorAuditStatus'), } model GetSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: GetSmsTemplateResponseBody(name='body'), } /** * @summary Query Text SMS Template Details * * @description - For details about the announcement of changes to the new and original interfaces, see [Announcement on Updates to SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Review Time: Under normal circumstances, Alibaba Cloud expects to complete the review within 2 hours after template submission (review working hours: Monday to Sunday 9:00~21:00, with statutory holidays postponed). It is recommended to submit your application before 18:00. * - If the template fails the review, the reason for the failure will be returned. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm=a2c4g.11186623.0.0.41fd339f3bPSCQ), invoke the [ModifySmsTemplate](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-modifysmstemplate?spm=a2c4g.11186623.0.0.5b1f6e8bQloFit) API or modify the SMS template on the [Template Management](https://dysms.console.aliyun.com/domestic/text/template) page. * - The current QuerySmsTemplate interface queries the audit details of a single template by template code. The [QuerySmsTemplateList](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-querysmstemplatelist?spm=a2c4g.11186623.0.0.24086e8bO8cFn4) interface can query the template details of all templates under your current account. * * @param request GetSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return GetSmsTemplateResponse */ async function getSmsTemplateWithOptions(request: GetSmsTemplateRequest, runtime: Util.RuntimeOptions): GetSmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'GetSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Query Text SMS Template Details * * @description - For details about the announcement of changes to the new and original interfaces, see [Announcement on Updates to SMS Service Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Review Time: Under normal circumstances, Alibaba Cloud expects to complete the review within 2 hours after template submission (review working hours: Monday to Sunday 9:00~21:00, with statutory holidays postponed). It is recommended to submit your application before 18:00. * - If the template fails the review, the reason for the failure will be returned. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm=a2c4g.11186623.0.0.41fd339f3bPSCQ), invoke the [ModifySmsTemplate](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-modifysmstemplate?spm=a2c4g.11186623.0.0.5b1f6e8bQloFit) API or modify the SMS template on the [Template Management](https://dysms.console.aliyun.com/domestic/text/template) page. * - The current QuerySmsTemplate interface queries the audit details of a single template by template code. The [QuerySmsTemplateList](https://help.aliyun.com/zh/sms/developer-reference/api-dysmsapi-2017-05-25-querysmstemplatelist?spm=a2c4g.11186623.0.0.24086e8bO8cFn4) interface can query the template details of all templates under your current account. * * @param request GetSmsTemplateRequest * @return GetSmsTemplateResponse */ async function getSmsTemplate(request: GetSmsTemplateRequest): GetSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return getSmsTemplateWithOptions(request, runtime); } model ListTagResourcesRequest { nextToken?: string(name='NextToken', description='The token used to query the next page.', example='23432453245'), ownerId?: long(name='OwnerId'), pageSize?: int32(name='PageSize', description='The number of entries per page.', example='20'), prodCode?: string(name='ProdCode', description='The name of the cloud service. Set the value to **dysms**.', example='dysms'), regionId?: string(name='RegionId', description='The region ID. Set the value to **cn-hangzhou**. This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='The code of the message template. Specify either the Tag or the ResourceId parameter.', example='SMS_23423423'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to TEMPLATE. This parameter is required.', example='TEMPLATE'), tag?: [ { key?: string(name='Key', description='The key of the tag.', example='TestKey'), value?: string(name='Value', description='The value of the tag.', example='TestValue'), } ](name='Tag', description='The tag list. Specify either the Tag or the ResourceId parameter. You can specify a maximum of 20 tags.'), } model ListTagResourcesResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), nextToken?: string(name='NextToken', description='The token used to query the next page.', example='"23432453245"'), requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'), tagResources?: { tagResource?: [ { resourceId?: string(name='ResourceId', description='The code of the message template.', example='SMS_23423****'), resourceType?: string(name='ResourceType', description='The type of resource.', example='ALIYUN::DYSMS::TEMPLATE'), tagKey?: string(name='TagKey', description='The tag key.', example='TestKey'), tagValue?: string(name='TagValue', description='The tag value.', example='TestValue'), } ](name='TagResource') }(name='TagResources', description='The list of tags.'), } model ListTagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ListTagResourcesResponseBody(name='body'), } /** * @summary Queries the tags of a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request ListTagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return ListTagResourcesResponse */ async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.nextToken)) { query['NextToken'] = request.nextToken; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.prodCode)) { query['ProdCode'] = request.prodCode; } if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ListTagResources', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the tags of a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request ListTagResourcesRequest * @return ListTagResourcesResponse */ async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return listTagResourcesWithOptions(request, runtime); } model ModifySmsSignRequest { ownerId?: long(name='OwnerId'), remark?: string(name='Remark', description='The scenario description of your released services. Provide the information of your services, such as a website URL, a domain name with an ICP filing, an app download URL, or the name of your WeChat official account or mini program. For sign-in scenarios, you must also provide an account and password for tests. A detailed description can improve the review efficiency of signatures and templates. > The description can be up to 200 characters in length. This parameter is required.', example='This is the abbreviation of our company.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signFileList?: [ { fileContents?: string(name='FileContents', description='The base64-encoded string of the signed files. The size of the image cannot exceed 2 MB. In some scenarios, documents are required to prove your identity. For more information, see [Signature specifications](https://help.aliyun.com/document_detail/108076.html). This parameter is required.', example='R0lGODlhHAAmAKIHAKqqqsvLy0hISObm5vf394uLiwAA'), fileSuffix?: string(name='FileSuffix', description='The format of the documents. You can upload multiple images. JPG, PNG, GIF, and JPEG are supported. In some scenarios, documents are required to prove your identity. For more information, see [Signature specifications](https://help.aliyun.com/document_detail/108076.html). > If the signature is used for other purposes or the signature source is an enterprise or public institution, you must upload some documents and an authorization letter. For more information, see [Documents](https://help.aliyun.com/document_detail/108076.html) and [Letter of authorization](https://help.aliyun.com/document_detail/56741.html). This parameter is required.', example='jpg'), } ](name='SignFileList', description='The list of signature files. This parameter is required.'), signName?: string(name='SignName', description='The signature. This parameter is required.', example='Aliyun'), signSource?: int32(name='SignSource', description='The source of the signature. Valid values: * **0**: full name or abbreviation of an enterprise or institution. * **1**: full name or abbreviation of a website with Ministry of Industry and Information Technology (MIIT) filing. * **2**: full name or abbreviation of an app. * **3**: full name or abbreviation of a WeChat official account or applet. * **4**: full name or abbreviation of an e-commerce store. * **5**: full name or abbreviation of a trademark. This parameter is required.', example='1'), signType?: int32(name='SignType', description='The type of the signature. Valid values: * **0**: verification-code signature * **1**: general-purpose signature', example='1'), } model ModifySmsSignResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), signName?: string(name='SignName', description='The signature.', example='Aliyun'), } model ModifySmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ModifySmsSignResponseBody(name='body'), } /** * @summary Modifies a rejected signature and submit it for approval. Signatures that are pending approval or have been approved cannot be modified. * * @description You can call the operation or use the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview) to modify an existing signature and submit the signature for approval. The signature must comply with the [signature specifications](https://help.aliyun.com/document_detail/108076.html). * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * > * * Signatures pending approval cannot be modified. * * You cannot modify a signature after it is approved. If you no longer need the signature, you can delete it. * * If you are an individual user, you cannot apply for a new signature on the same day that your signature is rejected or deleted. We recommend that you modify the rejected signature and submit it again. * * @param request ModifySmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return ModifySmsSignResponse */ async function modifySmsSignWithOptions(request: ModifySmsSignRequest, runtime: Util.RuntimeOptions): ModifySmsSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.signSource)) { query['SignSource'] = request.signSource; } if (!Util.isUnset(request.signType)) { query['SignType'] = request.signType; } var body : map[string]any = {}; if (!Util.isUnset(request.signFileList)) { body['SignFileList'] = request.signFileList; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'ModifySmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Modifies a rejected signature and submit it for approval. Signatures that are pending approval or have been approved cannot be modified. * * @description You can call the operation or use the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview) to modify an existing signature and submit the signature for approval. The signature must comply with the [signature specifications](https://help.aliyun.com/document_detail/108076.html). * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limits * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * > * * Signatures pending approval cannot be modified. * * You cannot modify a signature after it is approved. If you no longer need the signature, you can delete it. * * If you are an individual user, you cannot apply for a new signature on the same day that your signature is rejected or deleted. We recommend that you modify the rejected signature and submit it again. * * @param request ModifySmsSignRequest * @return ModifySmsSignResponse */ async function modifySmsSign(request: ModifySmsSignRequest): ModifySmsSignResponse { var runtime = new Util.RuntimeOptions{}; return modifySmsSignWithOptions(request, runtime); } model ModifySmsTemplateRequest { ownerId?: long(name='OwnerId'), remark?: string(name='Remark', description='The description of the message template. It is one of the reference information for template review. The description cannot exceed 100 characters in length. This parameter is required.', example='Modify the parameters of the template.'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the template code on the **Templates** tab. You can also call the [AddSmsTemplate](https://help.aliyun.com/document_detail/121208.html) operation to obtain the template code. This parameter is required.', example='SMS_15255****'), templateContent?: string(name='TemplateContent', description='The content of the template. The content must be 1 to 500 characters in length. > When you modify a template, design the template content based on the review comments. This parameter is required.', example='You are applying for mobile registration. The verification code is: ${code}, valid for 5 minutes!'), templateName?: string(name='TemplateName', description='The name of the template. The name must be 1 to 30 characters in length. This parameter is required.', example='aliyun verification code'), templateType?: int32(name='TemplateType', description='The type of the message. Valid values: * **0**: verification code * **1**: text message * **2**: promotional message * **3**: message sent to countries or regions outside the Chinese mainland This parameter is required.', example='1'), } model ModifySmsTemplateResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), templateCode?: string(name='TemplateCode', description='The code of the message template.', example='SMS_15255****'), } model ModifySmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ModifySmsTemplateResponseBody(name='body'), } /** * @deprecated OpenAPI ModifySmsTemplate is deprecated, please use Dysmsapi::2017-05-25::UpdateSmsTemplate instead. * * @summary Modifies the information of an unapproved message template and submits it for review again. * * @description After you apply for a message template, if the template fails to pass the review, you can call this operation to modify the template and submit the template again. You can call this operation to modify only a template for a specific message type. * The template content must comply with the [SMS template specifications](https://help.aliyun.com/document_detail/108253.html). * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request ModifySmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return ModifySmsTemplateResponse */ // Deprecated async function modifySmsTemplateWithOptions(request: ModifySmsTemplateRequest, runtime: Util.RuntimeOptions): ModifySmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } if (!Util.isUnset(request.templateContent)) { query['TemplateContent'] = request.templateContent; } if (!Util.isUnset(request.templateName)) { query['TemplateName'] = request.templateName; } if (!Util.isUnset(request.templateType)) { query['TemplateType'] = request.templateType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ModifySmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @deprecated OpenAPI ModifySmsTemplate is deprecated, please use Dysmsapi::2017-05-25::UpdateSmsTemplate instead. * * @summary Modifies the information of an unapproved message template and submits it for review again. * * @description After you apply for a message template, if the template fails to pass the review, you can call this operation to modify the template and submit the template again. You can call this operation to modify only a template for a specific message type. * The template content must comply with the [SMS template specifications](https://help.aliyun.com/document_detail/108253.html). * For more information, see [Usage notes](https://help.aliyun.com/document_detail/55324.html). * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request ModifySmsTemplateRequest * @return ModifySmsTemplateResponse */ // Deprecated async function modifySmsTemplate(request: ModifySmsTemplateRequest): ModifySmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return modifySmsTemplateWithOptions(request, runtime); } model QueryCardSmsTemplateRequest { templateCode?: string(name='TemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_4139'), } model QueryCardSmsTemplateResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { templates?: [ map[string]any ](name='Templates', description='The array of objects.'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model QueryCardSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryCardSmsTemplateResponseBody(name='body'), } /** * @summary Queries the review status of a message template. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryCardSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryCardSmsTemplateResponse */ async function queryCardSmsTemplateWithOptions(request: QueryCardSmsTemplateRequest, runtime: Util.RuntimeOptions): QueryCardSmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QueryCardSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the review status of a message template. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryCardSmsTemplateRequest * @return QueryCardSmsTemplateResponse */ async function queryCardSmsTemplate(request: QueryCardSmsTemplateRequest): QueryCardSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return queryCardSmsTemplateWithOptions(request, runtime); } model QueryCardSmsTemplateReportRequest { endDate?: string(name='EndDate', description='The end of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.', example='2020-10-11 00:00:01'), startDate?: string(name='StartDate', description='The beginning of the time range to query. Specify the time in the yyyy-MM-dd HH:mm:ss format.', example='2020-10-10 00:00:01'), templateCodes?: [ string ](name='TemplateCodes', description='The array of message templates. This parameter is required.'), } model QueryCardSmsTemplateReportResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { model?: [ map[string]any ](name='model', description='The details of the data returned.'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='CC89A90C-978F-46AC-B80D-54738371E7CA'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model QueryCardSmsTemplateReportResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryCardSmsTemplateReportResponseBody(name='body'), } /** * @summary Queries sent card messages. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryCardSmsTemplateReportRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryCardSmsTemplateReportResponse */ async function queryCardSmsTemplateReportWithOptions(request: QueryCardSmsTemplateReportRequest, runtime: Util.RuntimeOptions): QueryCardSmsTemplateReportResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.endDate)) { query['EndDate'] = request.endDate; } if (!Util.isUnset(request.startDate)) { query['StartDate'] = request.startDate; } if (!Util.isUnset(request.templateCodes)) { query['TemplateCodes'] = request.templateCodes; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QueryCardSmsTemplateReport', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries sent card messages. * * @description ### QPS limit * You can call this operation up to 300 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryCardSmsTemplateReportRequest * @return QueryCardSmsTemplateReportResponse */ async function queryCardSmsTemplateReport(request: QueryCardSmsTemplateReportRequest): QueryCardSmsTemplateReportResponse { var runtime = new Util.RuntimeOptions{}; return queryCardSmsTemplateReportWithOptions(request, runtime); } model QueryExtCodeSignRequest { extCode?: string(name='ExtCode', description='扩展码A3', example='01'), ownerId?: long(name='OwnerId'), pageNo?: long(name='PageNo', example='1'), pageSize?: long(name='PageSize', example='20'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名', example='示例值示例值'), } model QueryExtCodeSignResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: { list?: [ { active?: long(name='Active', description='是否可回收', example='1'), extCode?: string(name='ExtCode', description='扩展码A3', example='01'), sendCount?: long(name='SendCount', description='近1个月发送成功条数(只读)', example='69'), signName?: string(name='SignName', description='签名', example='示例值示例值'), source?: string(name='Source', description='来源', example='示例值示例值示例值'), } ](name='List'), pageNo?: long(name='PageNo', example='1'), pageSize?: long(name='PageSize', example='20'), total?: long(name='Total', example='5'), }(name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model QueryExtCodeSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryExtCodeSignResponseBody(name='body'), } /** * @summary 查询验证码签名 * * @param request QueryExtCodeSignRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryExtCodeSignResponse */ async function queryExtCodeSignWithOptions(request: QueryExtCodeSignRequest, runtime: Util.RuntimeOptions): QueryExtCodeSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.extCode)) { query['ExtCode'] = request.extCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageNo)) { query['PageNo'] = request.pageNo; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QueryExtCodeSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询验证码签名 * * @param request QueryExtCodeSignRequest * @return QueryExtCodeSignResponse */ async function queryExtCodeSign(request: QueryExtCodeSignRequest): QueryExtCodeSignResponse { var runtime = new Util.RuntimeOptions{}; return queryExtCodeSignWithOptions(request, runtime); } model QueryMobilesCardSupportRequest { mobiles?: [ map[string]any ](name='Mobiles', description='The list of mobile phone numbers. This parameter is required.'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_0000'), } model QueryMobilesCardSupportShrinkRequest { mobilesShrink?: string(name='Mobiles', description='The list of mobile phone numbers. This parameter is required.'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_0000'), } model QueryMobilesCardSupportResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { queryResult?: [ { mobile?: string(name='Mobile', description='The mobile phone number.', example='1380000****'), support?: boolean(name='Support', description='Indicates whether the mobile phone number supports card messages. Valid values: * **true** * **false**', example='true'), } ](name='QueryResult', description='The list of returned results.'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='08C17DFE-2E10-54F4-BAFB-7180039CC217'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model QueryMobilesCardSupportResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryMobilesCardSupportResponseBody(name='body'), } /** * @summary Checks whether a mobile phone number can receive card messages. * * @param tmpReq QueryMobilesCardSupportRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryMobilesCardSupportResponse */ async function queryMobilesCardSupportWithOptions(tmpReq: QueryMobilesCardSupportRequest, runtime: Util.RuntimeOptions): QueryMobilesCardSupportResponse { Util.validateModel(tmpReq); var request = new QueryMobilesCardSupportShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.mobiles)) { request.mobilesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.mobiles, 'Mobiles', 'json'); } var query = {}; if (!Util.isUnset(request.mobilesShrink)) { query['Mobiles'] = request.mobilesShrink; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QueryMobilesCardSupport', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Checks whether a mobile phone number can receive card messages. * * @param request QueryMobilesCardSupportRequest * @return QueryMobilesCardSupportResponse */ async function queryMobilesCardSupport(request: QueryMobilesCardSupportRequest): QueryMobilesCardSupportResponse { var runtime = new Util.RuntimeOptions{}; return queryMobilesCardSupportWithOptions(request, runtime); } model QueryPageSmartShortUrlLogRequest { createDateEnd?: long(name='CreateDateEnd', description='This parameter is required.', example='20181225'), createDateStart?: long(name='CreateDateStart', description='This parameter is required.', example='20181225'), ownerId?: long(name='OwnerId'), pageNo?: long(name='PageNo', description='This parameter is required.', example='1'), pageSize?: long(name='PageSize', description='This parameter is required.', example='10'), phoneNumber?: string(name='PhoneNumber', example='1390000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), shortUrl?: string(name='ShortUrl', example='http://ays.cn/****'), } model QueryPageSmartShortUrlLogResponseBody = { code?: string(name='Code', example='示例值示例值'), message?: string(name='Message', example='示例值示例值'), model?: { list?: [ { clickState?: long(name='ClickState', example='87'), clickTime?: long(name='ClickTime', example='51'), createTime?: long(name='CreateTime', example='64'), phoneNumber?: string(name='PhoneNumber', example='示例值示例值'), shortName?: string(name='ShortName', example='示例值示例值示例值'), shortUrl?: string(name='ShortUrl', example='示例值示例值示例值'), } ](name='List'), pageNo?: long(name='PageNo', example='74'), pageSize?: long(name='PageSize', example='15'), totalCount?: long(name='TotalCount', example='66'), totalPage?: long(name='TotalPage', example='86'), }(name='Model'), requestId?: string(name='RequestId', example='示例值示例值'), success?: boolean(name='Success', example='true'), } model QueryPageSmartShortUrlLogResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryPageSmartShortUrlLogResponseBody(name='body'), } /** * @summary 点击明细查询 * * @param request QueryPageSmartShortUrlLogRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryPageSmartShortUrlLogResponse */ async function queryPageSmartShortUrlLogWithOptions(request: QueryPageSmartShortUrlLogRequest, runtime: Util.RuntimeOptions): QueryPageSmartShortUrlLogResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.createDateEnd)) { query['CreateDateEnd'] = request.createDateEnd; } if (!Util.isUnset(request.createDateStart)) { query['CreateDateStart'] = request.createDateStart; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageNo)) { query['PageNo'] = request.pageNo; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.phoneNumber)) { query['PhoneNumber'] = request.phoneNumber; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.shortUrl)) { query['ShortUrl'] = request.shortUrl; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QueryPageSmartShortUrlLog', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 点击明细查询 * * @param request QueryPageSmartShortUrlLogRequest * @return QueryPageSmartShortUrlLogResponse */ async function queryPageSmartShortUrlLog(request: QueryPageSmartShortUrlLogRequest): QueryPageSmartShortUrlLogResponse { var runtime = new Util.RuntimeOptions{}; return queryPageSmartShortUrlLogWithOptions(request, runtime); } model QuerySendDetailsRequest { bizId?: string(name='BizId', description='The ID of the delivery receipt. The delivery receipt ID is the value of the BizId parameter that is returned when you call the SendSms or SendBatchSms operation.', example='134523^435****'), currentPage?: long(name='CurrentPage', description='The page number of the first page. This parameter is required.', example='1'), ownerId?: long(name='OwnerId'), pageSize?: long(name='PageSize', description='The number of items displayed per page. Valid values: 1 to 50. This parameter is required.', example='10'), phoneNumber?: string(name='PhoneNumber', description='The mobile numbers of the recipients. Format: * If you send messages in the Chinese mainland, specify an 11-digit mobile number, for example, 1390000\\\\*\\\\*\\\\*\\\\*. * If you send messages to countries or regions outside the Chinese mainland, specify this parameter in the \\\\<Area code>\\\\<Mobile number> format. Example: 8520000\\\\*\\\\*\\\\*\\\\*. This parameter is required.', example='1390000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), sendDate?: string(name='SendDate', description='The date when the message was sent. You can query messages that were sent within the last 30 days. Format: yyyyMMdd. Example: 20181225. This parameter is required.', example='20181228'), } model QuerySendDetailsResponseBody = { code?: string(name='Code', description='The response code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), smsSendDetailDTOs?: { smsSendDetailDTO?: [ { content?: string(name='Content', description='The content of the message.', example='【Aliyun】This is a test message.'), errCode?: string(name='ErrCode', description='The status code returned by the carrier. * If the message is delivered, "DELIVERED" is returned. * For information about the error codes that may be returned if the message is not delivered, see [error codes](https://help.aliyun.com/document_detail/101347.html).', example='DELIVERED'), outId?: string(name='OutId', description='The extended field.', example='123'), phoneNum?: string(name='PhoneNum', description='The mobile numbers of the recipients.', example='1390000****'), receiveDate?: string(name='ReceiveDate', description='The date and time when the message was received.', example='2019-01-08 16:44:13'), sendDate?: string(name='SendDate', description='The date and time when the message was sent.', example='2019-01-08 16:44:10'), sendStatus?: long(name='SendStatus', description='The delivery status of the message. Valid values: * **1**: The message has not received a delivery receipt yet. * **2**: The message failed to be delivered. * **3**: The message was delivered.', example='3'), templateCode?: string(name='TemplateCode', description='The ID of the message template.', example='SMS_12231****'), } ](name='SmsSendDetailDTO') }(name='SmsSendDetailDTOs', description='The details of the message.'), totalCount?: string(name='TotalCount', description='The number of sent messages.', example='1'), } model QuerySendDetailsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySendDetailsResponseBody(name='body'), } /** * @summary Queries the information about a message. * * @param request QuerySendDetailsRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySendDetailsResponse */ async function querySendDetailsWithOptions(request: QuerySendDetailsRequest, runtime: Util.RuntimeOptions): QuerySendDetailsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.bizId)) { query['BizId'] = request.bizId; } if (!Util.isUnset(request.currentPage)) { query['CurrentPage'] = request.currentPage; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.phoneNumber)) { query['PhoneNumber'] = request.phoneNumber; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.sendDate)) { query['SendDate'] = request.sendDate; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySendDetails', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the information about a message. * * @param request QuerySendDetailsRequest * @return QuerySendDetailsResponse */ async function querySendDetails(request: QuerySendDetailsRequest): QuerySendDetailsResponse { var runtime = new Util.RuntimeOptions{}; return querySendDetailsWithOptions(request, runtime); } model QuerySendStatisticsRequest { endDate?: string(name='EndDate', description='The end of the time range to query. Format: yyyyMMdd. Example: 20181225. This parameter is required.', example='20201003'), isGlobe?: int32(name='IsGlobe', description='The site from where the message is sent. Valid values: * **1**: China site * **2**: international site This parameter is required.', example='1'), ownerId?: long(name='OwnerId'), pageIndex?: int32(name='PageIndex', description='The page number. Default value: **1**. This parameter is required.', example='1'), pageSize?: int32(name='PageSize', description='The number of entries to return on each page. Valid values: **1 to 50**. This parameter is required.', example='10'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='The signature.', example='Aliyun'), startDate?: string(name='StartDate', description='The beginning of the time range to query. Format: yyyyMMdd. Example: 20181225. This parameter is required.', example='20201002'), templateType?: int32(name='TemplateType', description='The type of the message template. Valid values: Valid values: * **0**: verification code * **1**: notification * **2**: promotional message (Enterprise users only) * **3**: international purpose (Enterprise users only) * **7**: digital message', example='0'), } model QuerySendStatisticsResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { targetList?: [ { noRespondedCount?: long(name='NoRespondedCount', description='The number of messages without a delivery receipt.', example='1'), respondedFailCount?: long(name='RespondedFailCount', description='The number of messages with a delivery receipt that indicates a failure.', example='2'), respondedSuccessCount?: long(name='RespondedSuccessCount', description='The number of messages with a delivery receipt that indicates a success.', example='17'), sendDate?: string(name='SendDate', description='The date when the message is sent. Format: yyyyMMdd. Example: 20181225.', example='20201010'), totalCount?: long(name='TotalCount', description='The number of delivered messages.', example='20'), } ](name='TargetList', description='The details of the data returned.'), totalSize?: long(name='TotalSize', description='The total number of entries returned.', example='20'), }(name='Data', description='The data returned.'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E47708****'), } model QuerySendStatisticsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySendStatisticsResponseBody(name='body'), } /** * @summary Queries message delivery details. * * @description You can call the operation to query message delivery details, including the number of delivered messages, the number of messages with delivery receipts, and the time that a message is sent. If a large number of messages are sent on the specified date, you can specify the number of items displayed on each page and the number of pages to view the details by page. * ### QPS limits * You can call this operation up to 20 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySendStatisticsRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySendStatisticsResponse */ async function querySendStatisticsWithOptions(request: QuerySendStatisticsRequest, runtime: Util.RuntimeOptions): QuerySendStatisticsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.endDate)) { query['EndDate'] = request.endDate; } if (!Util.isUnset(request.isGlobe)) { query['IsGlobe'] = request.isGlobe; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageIndex)) { query['PageIndex'] = request.pageIndex; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.startDate)) { query['StartDate'] = request.startDate; } if (!Util.isUnset(request.templateType)) { query['TemplateType'] = request.templateType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySendStatistics', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries message delivery details. * * @description You can call the operation to query message delivery details, including the number of delivered messages, the number of messages with delivery receipts, and the time that a message is sent. If a large number of messages are sent on the specified date, you can specify the number of items displayed on each page and the number of pages to view the details by page. * ### QPS limits * You can call this operation up to 20 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySendStatisticsRequest * @return QuerySendStatisticsResponse */ async function querySendStatistics(request: QuerySendStatisticsRequest): QuerySendStatisticsResponse { var runtime = new Util.RuntimeOptions{}; return querySendStatisticsWithOptions(request, runtime); } model QueryShortUrlRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), shortUrl?: string(name='ShortUrl', description='The short URL. You can query the short URL by calling the [AddShortUrl](https://help.aliyun.com/document_detail/186774.html) operation. This parameter is required.', example='http://****.cn/6y8uy7'), } model QueryShortUrlResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { createDate?: string(name='CreateDate', description='The time when the short URL was created.', example='2019-01-08 16:44:13'), expireDate?: string(name='ExpireDate', description='The time when the short URL expires.', example='2019-01-22 11:21:11'), pageViewCount?: string(name='PageViewCount', description='The PV.', example='300'), shortUrl?: string(name='ShortUrl', description='The short URL.', example='http://****.cn/6y8uy7'), shortUrlName?: string(name='ShortUrlName', description='The service name of the short URL.', example='The Alibaba Cloud Short Link service.'), shortUrlStatus?: string(name='ShortUrlStatus', description='The status of the short URL. Valid values: * **expired** * **effective** * **audit** * **reject**', example='expired'), sourceUrl?: string(name='SourceUrl', description='The source address.', example='https://www.****.com/product/sms'), uniqueVisitorCount?: string(name='UniqueVisitorCount', description='The UV.', example='23'), }(name='Data', description='The details of the short URL.'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), } model QueryShortUrlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QueryShortUrlResponseBody(name='body'), } /** * @summary Queries the status of a short URL. * * @description ### QPS limits * You can call this operation up to 20 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryShortUrlRequest * @param runtime runtime options for this request RuntimeOptions * @return QueryShortUrlResponse */ async function queryShortUrlWithOptions(request: QueryShortUrlRequest, runtime: Util.RuntimeOptions): QueryShortUrlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var body : map[string]any = {}; if (!Util.isUnset(request.shortUrl)) { body['ShortUrl'] = request.shortUrl; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'QueryShortUrl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the status of a short URL. * * @description ### QPS limits * You can call this operation up to 20 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QueryShortUrlRequest * @return QueryShortUrlResponse */ async function queryShortUrl(request: QueryShortUrlRequest): QueryShortUrlResponse { var runtime = new Util.RuntimeOptions{}; return queryShortUrlWithOptions(request, runtime); } model QuerySingleSmsQualificationRequest { orderId?: long(name='OrderId', description='工单id', example='2001****'), ownerId?: long(name='OwnerId'), qualificationGroupId?: long(name='QualificationGroupId', description='资质id This parameter is required.', example='10000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model QuerySingleSmsQualificationResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: { adminIDCardExpDate?: string(name='AdminIDCardExpDate', description='经办人身份证有效期', example='2023-01-01~2033-01-01'), adminIDCardFrontFace?: string(name='AdminIDCardFrontFace', description='经办人身份证国徽面,产品需求,要求身份证可以分正反面上传', example='https://******.aliyuncs.com/******'), adminIDCardNo?: string(name='AdminIDCardNo', description='经办人身份证号码', example='511391********5123'), adminIDCardPic?: string(name='AdminIDCardPic', description='经办人身份证图片地址,正反面合一', example='https://******.aliyuncs.com/******'), adminIDCardType?: string(name='AdminIDCardType', description='管理员身份证类型', example='identityCard'), adminName?: string(name='AdminName', description='经办人姓名', example='示例值示例值'), adminPhoneNo?: string(name='AdminPhoneNo', description='经办人手机号码', example='137*******'), businessLicensePics?: [ { licensePic?: string(name='LicensePic', example='123456/111.png'), picUrl?: string(name='PicUrl', description='文件的完整路径', example='https://******.aliyuncs.com/******'), type?: string(name='Type', example='businessLicense'), } ](name='BusinessLicensePics', description='证件信息'), businessType?: string(name='BusinessType', description='行业类型,在当前模式下是可以用产品线code来区分', example='dysms'), companyName?: string(name='CompanyName', description='公司名称', example='示例值示例值'), companyType?: string(name='CompanyType', description='企业类型, COMPANY:公司,政府或者事业单位:NON_PROFIT_ORGANIZATION', example='COMPANY'), effTimeStr?: string(name='EffTimeStr', example='2023-01-01~2033-01-01'), legalPersonIDCardNo?: string(name='LegalPersonIDCardNo', description='法人身份证号码', example='511391********5123'), legalPersonIDCardType?: string(name='LegalPersonIDCardType', description='法人身份证类型', example='identityCard'), legalPersonIdCardEffTime?: string(name='LegalPersonIdCardEffTime', description='法人身份证有效期', example='2023-01-01~2033-01-01'), legalPersonName?: string(name='LegalPersonName', description='法人姓名', example='示例值'), organizationCode?: string(name='OrganizationCode', description='社会统一信用代码', example='910X********0012'), otherFiles?: [ { licensePic?: string(name='LicensePic', example='123456/111.png'), picUrl?: string(name='PicUrl', description='文件的完整路径', example='https://******.aliyuncs.com/******'), } ](name='OtherFiles', description='更多资料'), qualificationGroupId?: long(name='QualificationGroupId', example='10000****'), qualificationName?: string(name='QualificationName', description='资质名称', example='示例值示例值'), remark?: string(name='Remark', description='备注', example='示例值示例值'), state?: string(name='State', description='当前审核状态', example='PASSED'), useBySelf?: boolean(name='UseBySelf', description='是否自用', example='false'), whetherShare?: boolean(name='WhetherShare', example='false'), workOrderId?: long(name='WorkOrderId', description='乾坤袋工单ID', example='2001****'), }(name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model QuerySingleSmsQualificationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySingleSmsQualificationResponseBody(name='body'), } /** * @summary 查询单个资质详情 * * @param request QuerySingleSmsQualificationRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySingleSmsQualificationResponse */ async function querySingleSmsQualificationWithOptions(request: QuerySingleSmsQualificationRequest, runtime: Util.RuntimeOptions): QuerySingleSmsQualificationResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.orderId)) { query['OrderId'] = request.orderId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationGroupId)) { query['QualificationGroupId'] = request.qualificationGroupId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySingleSmsQualification', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询单个资质详情 * * @param request QuerySingleSmsQualificationRequest * @return QuerySingleSmsQualificationResponse */ async function querySingleSmsQualification(request: QuerySingleSmsQualificationRequest): QuerySingleSmsQualificationResponse { var runtime = new Util.RuntimeOptions{}; return querySingleSmsQualificationWithOptions(request, runtime); } model QuerySmsAuthorizationLetterRequest { authorizationLetterIdList?: [ long ](name='AuthorizationLetterIdList', description='委托授权书id列表'), organizationCode?: string(name='OrganizationCode', description='授权方社会统一信用代码', example='9****************A'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名名称(支持命中签名范围查询)', example='示例值示例值'), state?: string(name='State', description='授权书审核状态,INT:审核中,PASSED:审核通过', example='PASSED'), status?: string(name='Status', description='授权书可用状态,VALID可用,INVALID不可用', example='VALID'), } model QuerySmsAuthorizationLetterShrinkRequest { authorizationLetterIdListShrink?: string(name='AuthorizationLetterIdList', description='委托授权书id列表'), organizationCode?: string(name='OrganizationCode', description='授权方社会统一信用代码', example='9****************A'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名名称(支持命中签名范围查询)', example='示例值示例值'), state?: string(name='State', description='授权书审核状态,INT:审核中,PASSED:审核通过', example='PASSED'), status?: string(name='Status', description='授权书可用状态,VALID可用,INVALID不可用', example='VALID'), } model QuerySmsAuthorizationLetterResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: [ { authorization?: string(name='Authorization', description='委托授权方', example='示例值示例值'), authorizationLetterExpDate?: string(name='AuthorizationLetterExpDate', description='委托授权书有效期', example='2023-01-01~2026-01-01'), authorizationLetterId?: long(name='AuthorizationLetterId', description='委托授权书id', example='10000******'), authorizationLetterName?: string(name='AuthorizationLetterName', description='委托授权书命名', example='示例值示例值'), authorizationLetterPic?: string(name='AuthorizationLetterPic', description='委托授权书图片地址'), organizationCode?: string(name='OrganizationCode', description='授权方统一社会信用代码', example='9****************A'), proxyAuthorization?: string(name='ProxyAuthorization', description='被委托授权方', example='示例值示例值示例值'), signScope?: string(name='SignScope', description='委托授权签名范围', example='示例值'), state?: string(name='State', description='委托授权书审核状态(初始化INT/审核通过PASSED)', example='PASSED'), status?: string(name='Status', description='委托授权书可用状态(可用VALID/不可用INVALID)', example='VALID'), } ](name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071D'), success?: boolean(name='Success', example='true'), } model QuerySmsAuthorizationLetterResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsAuthorizationLetterResponseBody(name='body'), } /** * @summary 查询委托授权书 * * @param tmpReq QuerySmsAuthorizationLetterRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsAuthorizationLetterResponse */ async function querySmsAuthorizationLetterWithOptions(tmpReq: QuerySmsAuthorizationLetterRequest, runtime: Util.RuntimeOptions): QuerySmsAuthorizationLetterResponse { Util.validateModel(tmpReq); var request = new QuerySmsAuthorizationLetterShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.authorizationLetterIdList)) { request.authorizationLetterIdListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.authorizationLetterIdList, 'AuthorizationLetterIdList', 'json'); } var query = {}; if (!Util.isUnset(request.authorizationLetterIdListShrink)) { query['AuthorizationLetterIdList'] = request.authorizationLetterIdListShrink; } if (!Util.isUnset(request.organizationCode)) { query['OrganizationCode'] = request.organizationCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.state)) { query['State'] = request.state; } if (!Util.isUnset(request.status)) { query['Status'] = request.status; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsAuthorizationLetter', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询委托授权书 * * @param request QuerySmsAuthorizationLetterRequest * @return QuerySmsAuthorizationLetterResponse */ async function querySmsAuthorizationLetter(request: QuerySmsAuthorizationLetterRequest): QuerySmsAuthorizationLetterResponse { var runtime = new Util.RuntimeOptions{}; return querySmsAuthorizationLetterWithOptions(request, runtime); } model QuerySmsQualificationRecordRequest { companyName?: string(name='CompanyName', description='公司名', example='示例值'), legalPersonName?: string(name='LegalPersonName', description='法人姓名', example='示例值示例值'), ownerId?: long(name='OwnerId'), pageNo?: long(name='PageNo', example='1'), pageSize?: long(name='PageSize', example='20'), qualificationGroupName?: string(name='QualificationGroupName', description='资质组名称', example='示例值示例值'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), state?: string(name='State', description='审核状态。INT:审核中FAILED:审核失败,PASSED:审核通过,NOT_FINISH:资料待补充,CANCELED:已撤回', example='PASSED'), useBySelf?: boolean(name='UseBySelf', description='是否自用', example='true'), workOrderId?: long(name='WorkOrderId', description='工单ID', example='2001****'), } model QuerySmsQualificationRecordResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: { list?: [ { auditRemark?: string(name='AuditRemark', description='审核备注', example='示例值示例值'), auditTime?: string(name='AuditTime', description='审核时间', example='2024-12-26 17:29:04'), companyName?: string(name='CompanyName', description='公司名称或实人认证姓名', example='示例值示例值示例值'), createDate?: string(name='CreateDate', description='创建时间', example='2025-02-20 11:59:30'), groupId?: long(name='GroupId', description='资质组ID', example='10000****'), legalPersonName?: string(name='LegalPersonName', description='法人名称', example='示例值示例值'), qualificationGroupName?: string(name='QualificationGroupName', description='资质组名称', example='示例值示例值示例值'), stateName?: string(name='StateName', description='审核状态名', example='INT'), useBySelf?: string(name='UseBySelf', description='是否自用', example='true'), workOrderId?: long(name='WorkOrderId', description='工单ID', example='2001****'), } ](name='List'), pageNo?: long(name='PageNo', example='1'), pageSize?: long(name='PageSize', example='20'), total?: long(name='Total', example='25'), }(name='Data'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model QuerySmsQualificationRecordResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsQualificationRecordResponseBody(name='body'), } /** * @summary 查询资质审核列表页 * * @param request QuerySmsQualificationRecordRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsQualificationRecordResponse */ async function querySmsQualificationRecordWithOptions(request: QuerySmsQualificationRecordRequest, runtime: Util.RuntimeOptions): QuerySmsQualificationRecordResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.companyName)) { query['CompanyName'] = request.companyName; } if (!Util.isUnset(request.legalPersonName)) { query['LegalPersonName'] = request.legalPersonName; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageNo)) { query['PageNo'] = request.pageNo; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.qualificationGroupName)) { query['QualificationGroupName'] = request.qualificationGroupName; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.state)) { query['State'] = request.state; } if (!Util.isUnset(request.useBySelf)) { query['UseBySelf'] = request.useBySelf; } if (!Util.isUnset(request.workOrderId)) { query['WorkOrderId'] = request.workOrderId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsQualificationRecord', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 查询资质审核列表页 * * @param request QuerySmsQualificationRecordRequest * @return QuerySmsQualificationRecordResponse */ async function querySmsQualificationRecord(request: QuerySmsQualificationRecordRequest): QuerySmsQualificationRecordResponse { var runtime = new Util.RuntimeOptions{}; return querySmsQualificationRecordWithOptions(request, runtime); } model QuerySmsSignRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='The signature. This parameter is required.', example='Aliyun'), } model QuerySmsSignResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), createDate?: string(name='CreateDate', description='The date and time when the signature was created.', example='2019-01-08 16:44:13'), message?: string(name='Message', description='The returned message.', example='OK'), reason?: string(name='Reason', description='The remarks of the review. Valid values: * If the signature is in the **Approved** or **Pending Approval** state, No Remarks is returned. * If the signature is in the **Not Approved** state, the reason why the signature is rejected is returned.', example='The document cannot verify the authenticity of the information. Please upload it again.'), requestId?: string(name='RequestId', description='The request ID.', example='CC89A90C-978F-46AC-B80D-54738371E7CA'), signName?: string(name='SignName', description='The signature.', example='Aliyun'), signStatus?: int32(name='SignStatus', description='The status of the signature. Valid values: * **0**: The signature is pending approval. * **1**: The signature is approved. * **2**: The signature is rejected. The Reason parameter indicates the reason why the signature is rejected. * **10**: The signature is cancelled.', example='1'), } model QuerySmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsSignResponseBody(name='body'), } /** * @summary Queries the status of a signature. * * @description After you apply for an SMS signature, you can query its status by using the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm) or calling the operation. If the signature is rejected, you can modify the signature based on the reason why it is rejected. * ### QPS limits * You can call this API operation up to 500 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsSignResponse */ async function querySmsSignWithOptions(request: QuerySmsSignRequest, runtime: Util.RuntimeOptions): QuerySmsSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries the status of a signature. * * @description After you apply for an SMS signature, you can query its status by using the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm) or calling the operation. If the signature is rejected, you can modify the signature based on the reason why it is rejected. * ### QPS limits * You can call this API operation up to 500 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsSignRequest * @return QuerySmsSignResponse */ async function querySmsSign(request: QuerySmsSignRequest): QuerySmsSignResponse { var runtime = new Util.RuntimeOptions{}; return querySmsSignWithOptions(request, runtime); } model QuerySmsSignListRequest { ownerId?: long(name='OwnerId'), pageIndex?: int32(name='PageIndex', description='The page number. Default value: **1**.', example='1'), pageSize?: int32(name='PageSize', description='The number of signatures per page. Valid values: **1 to 50**.', example='10'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model QuerySmsSignListResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'), message?: string(name='Message', description='The returned message.', example='OK'), pageSize?: int32(name='PageSize', description='The number of signatures per page. Valid values: **1 to 50**.', example='10'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E47708****'), smsSignList?: [ { auditStatus?: string(name='AuditStatus', description='The approval status of the signature. Valid values: * **AUDIT_STATE_INIT**: The signature is pending approval. * **AUDIT_STATE_PASS**: The signature is approved. * **AUDIT_STATE_NOT_PASS**: The signature is rejected. You can view the reason in the Reason response parameter. * **AUDIT_STATE_CANCEL**: The approval is canceled.', example='AUDIT_STATE_NOT_PASS'), authorizationLetterId?: long(name='AuthorizationLetterId'), businessType?: string(name='BusinessType', description='The type of the signature scenario. The return value ends with "type". Valid values: * Verification code type * General-purpose type', example='Verification code type'), createDate?: string(name='CreateDate', description='The time when the signature was created. Format: yyyy-MM-dd HH:mm:ss.', example='2020-01-08 16:44:13'), orderId?: string(name='OrderId', description='The ticket ID.', example='236****5'), reason?: { rejectDate?: string(name='RejectDate', description='The time when the signature was rejected. Format: yyyy-MM-dd HH:mm:ss.', example='2020-01-08 19:02:13'), rejectInfo?: string(name='RejectInfo', description='The reason why the signature was rejected.', example='The document cannot verify the authenticity of the information. Please upload it again.'), rejectSubInfo?: string(name='RejectSubInfo', description='The remarks about the rejection.', example='The document cannot verify the authenticity of the information. Please upload it again.'), }(name='Reason', description='The approval remarks. * If the value of AuditStatus is **AUDIT_STATE_PASS** or **AUDIT_STATE_INIT**, the value of Reason is No Approval Remarks. * If the value of AuditStatus is **AUDIT_STATE_NOT_PASS**, the reason why the signature is rejected is returned.'), signName?: string(name='SignName', description='The name of the signature.', example='Aliyun'), authorizationLetterAuditPass?: boolean(name='authorizationLetterAuditPass'), } ](name='SmsSignList', description='The queried message signatures.'), totalCount?: long(name='TotalCount', description='The total number of signatures.', example='100'), } model QuerySmsSignListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsSignListResponseBody(name='body'), } /** * @summary Queries message signatures by page. * * @description You can call this operation to query the details of message signatures, including the name, creation time, and approval status of each signature. If a message template is rejected, the reason is returned. Modify the message signature based on the reason. * ### QPS limit * You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsSignListRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsSignListResponse */ async function querySmsSignListWithOptions(request: QuerySmsSignListRequest, runtime: Util.RuntimeOptions): QuerySmsSignListResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageIndex)) { query['PageIndex'] = request.pageIndex; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsSignList', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries message signatures by page. * * @description You can call this operation to query the details of message signatures, including the name, creation time, and approval status of each signature. If a message template is rejected, the reason is returned. Modify the message signature based on the reason. * ### QPS limit * You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsSignListRequest * @return QuerySmsSignListResponse */ async function querySmsSignList(request: QuerySmsSignListRequest): QuerySmsSignListResponse { var runtime = new Util.RuntimeOptions{}; return querySmsSignListWithOptions(request, runtime); } model QuerySmsTemplateRequest { ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the template code on the **Templates** tab. You can also call the [AddSmsTemplate](https://help.aliyun.com/document_detail/121208.html) operation to obtain the template code. This parameter is required.', example='SMS_1525***'), } model QuerySmsTemplateResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), createDate?: string(name='CreateDate', description='The time when the message template was created.', example='2019-06-04 11:42:17'), message?: string(name='Message', description='The returned message.', example='OK'), reason?: string(name='Reason', description='The approval remarks. * If the value of AuditStatus is **AUDIT_STATE_PASS** or **AUDIT_STATE_INIT**, the value of Reason is No Approval Remarks. * If the value of AuditStatus is **AUDIT_STATE_NOT_PASS**, the reason why the message template is rejected is returned.', example='The document cannot verify the authenticity of the information. Please upload it again.'), requestId?: string(name='RequestId', description='The request ID.', example='0A974B78-02BF-4C79-ADF3-90CFBA1B55B1'), templateCode?: string(name='TemplateCode', description='The code of the message template.', example='SMS_16703****'), templateContent?: string(name='TemplateContent', description='The content of the message template.', example='You are applying for mobile registration. The verification code is: ${code}, valid for 5 minutes!'), templateName?: string(name='TemplateName', description='The name of the message template.', example='aliyun verification code'), templateStatus?: int32(name='TemplateStatus', description='The approval status of the message template. Valid values: * **0**: The message template is pending approval. * **1**: The message template is approved. * **AUDIT_STATE_NOT_PASS**: The message template is rejected. You can view the reason in the Reason response parameter. * **10**: The approval is canceled.', example='1'), templateType?: int32(name='TemplateType', description='The type of the message. Valid values: * **0**: verification code * **1**: notification message * **2**: promotional message * **3**: message sent to countries or regions outside the Chinese mainland', example='1'), } model QuerySmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsTemplateResponseBody(name='body'), } /** * @deprecated OpenAPI QuerySmsTemplate is deprecated, please use Dysmsapi::2017-05-25::GetSmsTemplate instead. * * @summary Queries the approval status of a message template. * * @description After you create a message template, you can call this operation to query the approval status of the template. If a message template is rejected, the reason is returned. Modify the message template based on the reason. * ### QPS limit * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsTemplateResponse */ // Deprecated async function querySmsTemplateWithOptions(request: QuerySmsTemplateRequest, runtime: Util.RuntimeOptions): QuerySmsTemplateResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @deprecated OpenAPI QuerySmsTemplate is deprecated, please use Dysmsapi::2017-05-25::GetSmsTemplate instead. * * @summary Queries the approval status of a message template. * * @description After you create a message template, you can call this operation to query the approval status of the template. If a message template is rejected, the reason is returned. Modify the message template based on the reason. * ### QPS limit * You can call this operation up to 5,000 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsTemplateRequest * @return QuerySmsTemplateResponse */ // Deprecated async function querySmsTemplate(request: QuerySmsTemplateRequest): QuerySmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return querySmsTemplateWithOptions(request, runtime); } model QuerySmsTemplateListRequest { ownerId?: long(name='OwnerId'), pageIndex?: int32(name='PageIndex', description='The page number. Default value: **1**.', example='1'), pageSize?: int32(name='PageSize', description='The number of templates per page. Valid values: **1 to 50**.', example='10'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model QuerySmsTemplateListResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), currentPage?: int32(name='CurrentPage', description='The page number. Default value: **1**.', example='1'), message?: string(name='Message', description='The returned message.', example='OK'), pageSize?: int32(name='PageSize', description='The number of templates per page. Valid values: **1 to 50**.', example='10'), requestId?: string(name='RequestId', description='The request ID.', example='819BE656-D2E0-4858-8B21-B2E47708****'), smsTemplateList?: [ { auditStatus?: string(name='AuditStatus', description='The approval status of the message template. Valid values: * **AUDIT_STATE_INIT**: The message template is pending approval. * **AUDIT_STATE_PASS**: The message template is approved. * **AUDIT_STATE_NOT_PASS**: The message template is rejected. You can view the reason in the Reason response parameter. * **AUDIT_STATE_CANCEL** or **AUDIT_SATE_CANCEL**: The approval is canceled.', example='AUDIT_STATE_PASS'), createDate?: string(name='CreateDate', description='The time when the message template was created. The time is in the yyyy-MM-dd HH:mm:ss format.', example='2020-06-04 11:42:17'), orderId?: string(name='OrderId', description='The ticket ID.', example='2361****'), outerTemplateType?: int32(name='OuterTemplateType', description='The type of the message template. We recommend that you specify this parameter. Valid values: * **0**: verification code * **1**: notification message * **2**: promotional message * **3**: message sent to countries or regions outside the Chinese mainland * **7**: digital message > The template type is the same as the value of the TemplateType parameter in the AddSmsTemplate and ModifySmsTemplate operations.', example='0'), reason?: { rejectDate?: string(name='RejectDate', description='The time when the message template was rejected. Format: yyyy-MM-dd HH:mm:ss.', example='2020-06-04 16:01:17'), rejectInfo?: string(name='RejectInfo', description='The reason why the message template was rejected.', example='The document cannot verify the authenticity of the information. Please upload it again.'), rejectSubInfo?: string(name='RejectSubInfo', description='The remarks about the rejection.', example='The document cannot verify the authenticity of the information. Please upload it again.'), }(name='Reason', description='The approval remarks. * If the value of AuditStatus is **AUDIT_STATE_PASS** or **AUDIT_STATE_INIT**, the value of Reason is No Approval Remarks. * If the value of AuditStatus is **AUDIT_STATE_NOT_PASS**, the reason why the message template is rejected is returned.'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the template code on the **Templates** tab. You can also call the [AddSmsTemplate](https://help.aliyun.com/document_detail/121208.html) operation to obtain the template code.', example='SMS_1525***'), templateContent?: string(name='TemplateContent', description='The content of the message template.', example='123456789'), templateName?: string(name='TemplateName', description='The name of the message template.', example='aliyun verification code'), templateType?: int32(name='TemplateType', description='The type of the message template. Valid values: * **0**: notification message * **1**: promotional message * **2**: verification code * **6**: message sent to countries or regions outside the Chinese mainland * **7**: digital message', example='7'), } ](name='SmsTemplateList', description='The queried message templates.'), totalCount?: long(name='TotalCount', description='The total number of templates.', example='100'), } model QuerySmsTemplateListResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: QuerySmsTemplateListResponseBody(name='body'), } /** * @summary Queries message templates. * * @description You can call this operation to query the details of message templates, including the name, creation time, and approval status of each template. If a message template is rejected, the reason is returned. Modify the message template based on the reason. * ### QPS limit * You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsTemplateListRequest * @param runtime runtime options for this request RuntimeOptions * @return QuerySmsTemplateListResponse */ async function querySmsTemplateListWithOptions(request: QuerySmsTemplateListRequest, runtime: Util.RuntimeOptions): QuerySmsTemplateListResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.pageIndex)) { query['PageIndex'] = request.pageIndex; } if (!Util.isUnset(request.pageSize)) { query['PageSize'] = request.pageSize; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'QuerySmsTemplateList', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Queries message templates. * * @description You can call this operation to query the details of message templates, including the name, creation time, and approval status of each template. If a message template is rejected, the reason is returned. Modify the message template based on the reason. * ### QPS limit * You can call this operation up to 10 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request QuerySmsTemplateListRequest * @return QuerySmsTemplateListResponse */ async function querySmsTemplateList(request: QuerySmsTemplateListRequest): QuerySmsTemplateListResponse { var runtime = new Util.RuntimeOptions{}; return querySmsTemplateListWithOptions(request, runtime); } model RequiredPhoneCodeRequest { ownerId?: long(name='OwnerId'), phoneNo?: string(name='PhoneNo', description='This parameter is required.', example='137****1234'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model RequiredPhoneCodeResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: string(name='Data', example='-'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model RequiredPhoneCodeResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: RequiredPhoneCodeResponseBody(name='body'), } /** * @summary 验证手机验证码 * * @param request RequiredPhoneCodeRequest * @param runtime runtime options for this request RuntimeOptions * @return RequiredPhoneCodeResponse */ async function requiredPhoneCodeWithOptions(request: RequiredPhoneCodeRequest, runtime: Util.RuntimeOptions): RequiredPhoneCodeResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.phoneNo)) { query['PhoneNo'] = request.phoneNo; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'RequiredPhoneCode', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 验证手机验证码 * * @param request RequiredPhoneCodeRequest * @return RequiredPhoneCodeResponse */ async function requiredPhoneCode(request: RequiredPhoneCodeRequest): RequiredPhoneCodeResponse { var runtime = new Util.RuntimeOptions{}; return requiredPhoneCodeWithOptions(request, runtime); } model SendBatchCardSmsRequest { cardTemplateCode?: string(name='CardTemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_3245'), cardTemplateParamJson?: string(name='CardTemplateParamJson', description='The variables of the card message template.', example='[{\\\\"customurl\\\\":\\\\"http://www.alibaba.com\\\\",\\\\"dyncParams\\\\":\\\\"{\\\\\\\\\\\\"a\\\\\\\\\\\\":\\\\\\\\\\\\"hello\\\\\\\\\\\\",\\\\\\\\\\\\"b\\\\\\\\\\\\":\\\\\\\\\\\\"world\\\\\\\\\\\\"}\\\\"}]'), digitalTemplateCode?: string(name='DigitalTemplateCode', description='The code of the digital message template that applies when the card message is rolled back. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved.', example='DIGITAL_SMS_234080176'), digitalTemplateParamJson?: string(name='DigitalTemplateParamJson', description='The variables of the digital message template.', example='[{"a":1,"b":2},{"a":9,"b":8}]'), fallbackType?: string(name='FallbackType', description='The rollback type. Valid values: * **SMS**: text message * **DIGITALSMS**: digital message * **NONE**: none This parameter is required.', example='SMS'), outId?: string(name='OutId', description='The ID that is reserved for the caller of the operation.', example='16545681783595370'), phoneNumberJson?: string(name='PhoneNumberJson', description='The mobile numbers of the recipients. This parameter is required.', example='[\\\\"1390000****\\\\",\\\\"1370000****\\\\"]"'), signNameJson?: string(name='SignNameJson', description='The signature. You can view the template code in the **Signature** column on the **Signaturess** tab of the **Go China** page in the Alibaba Cloud SMS console. > The signatures must be approved and correspond to the mobile numbers in sequence. This parameter is required.', example='[\\\\"aliyun\\\\",\\\\"aliyuncode\\\\"]'), smsTemplateCode?: string(name='SmsTemplateCode', description='The code of the text message template that applies when the card message is rolled back. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved.', example='SMS_234251075'), smsTemplateParamJson?: string(name='SmsTemplateParamJson', description='The variables of the text message template.', example='[{"a":1,"b":2},{"a":9,"b":8}]'), smsUpExtendCodeJson?: string(name='SmsUpExtendCodeJson', description='The extension code of the upstream message.', example='[\\\\"6\\\\",\\\\"6\\\\"]'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Alibaba Cloud console](https://dysms.console.aliyun.com/dysms.htm?spm=5176.12818093.categories-n-products.ddysms.3b2816d0xml2NA#/overview), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the **template code** on the **Templates** tab. > You must specify a message template that is created in the SMS console and approved by Alibaba Cloud. If you send messages to countries or regions outside the Chinese mainland, use the corresponding message templates.', example='SMS_20375****'), templateParamJson?: string(name='TemplateParamJson', description='The value of the variable in the message template. > If you need to add line breaks to the JSON template, make sure that the format is valid. In addition, the sequence of variable values must be the same as that of the mobile numbers and signatures.', example='[{"name":"TemplateParamJson"},{"name":"TemplateParamJson"}]'), } model SendBatchCardSmsResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * For more information about other response codes, see [API error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { bizCardId?: string(name='BizCardId', description='The ID of the card message.', example='123'), bizDigitalId?: string(name='BizDigitalId', description='The ID of the digital message.', example='3214'), bizSmsId?: string(name='BizSmsId', description='The ID of the text message.', example='3256'), cardTmpState?: int32(name='CardTmpState', description='The review status of the card message template. * **0**: pending approval * **1**: approved * **2**: rejected > Unapproved card messages are rolled back.', example='0'), mediaMobiles?: string(name='MediaMobiles', description='The mobile phone number from which the card message is sent.', example='1390000****'), notMediaMobiles?: string(name='NotMediaMobiles', description='The mobile phone number whose card message is rolled back.', example='1390000****'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'), success?: boolean(name='Success', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), } model SendBatchCardSmsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SendBatchCardSmsResponseBody(name='body'), } /** * @summary Sends multiple card messages at a time. * * @description You can call the operation to send multiple card messages to a maximum of mobile phone numbers at a time. Different signatures and rollback settings can be specified for the mobile phone numbers. * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request SendBatchCardSmsRequest * @param runtime runtime options for this request RuntimeOptions * @return SendBatchCardSmsResponse */ async function sendBatchCardSmsWithOptions(request: SendBatchCardSmsRequest, runtime: Util.RuntimeOptions): SendBatchCardSmsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.cardTemplateCode)) { query['CardTemplateCode'] = request.cardTemplateCode; } if (!Util.isUnset(request.cardTemplateParamJson)) { query['CardTemplateParamJson'] = request.cardTemplateParamJson; } if (!Util.isUnset(request.digitalTemplateCode)) { query['DigitalTemplateCode'] = request.digitalTemplateCode; } if (!Util.isUnset(request.digitalTemplateParamJson)) { query['DigitalTemplateParamJson'] = request.digitalTemplateParamJson; } if (!Util.isUnset(request.fallbackType)) { query['FallbackType'] = request.fallbackType; } if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.phoneNumberJson)) { query['PhoneNumberJson'] = request.phoneNumberJson; } if (!Util.isUnset(request.signNameJson)) { query['SignNameJson'] = request.signNameJson; } if (!Util.isUnset(request.smsTemplateCode)) { query['SmsTemplateCode'] = request.smsTemplateCode; } if (!Util.isUnset(request.smsTemplateParamJson)) { query['SmsTemplateParamJson'] = request.smsTemplateParamJson; } if (!Util.isUnset(request.smsUpExtendCodeJson)) { query['SmsUpExtendCodeJson'] = request.smsUpExtendCodeJson; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } if (!Util.isUnset(request.templateParamJson)) { query['TemplateParamJson'] = request.templateParamJson; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'SendBatchCardSms', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Sends multiple card messages at a time. * * @description You can call the operation to send multiple card messages to a maximum of mobile phone numbers at a time. Different signatures and rollback settings can be specified for the mobile phone numbers. * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request SendBatchCardSmsRequest * @return SendBatchCardSmsResponse */ async function sendBatchCardSms(request: SendBatchCardSmsRequest): SendBatchCardSmsResponse { var runtime = new Util.RuntimeOptions{}; return sendBatchCardSmsWithOptions(request, runtime); } model SendBatchSmsRequest { outId?: string(name='OutId', description='The extension field of the external record. The value is a string that contains no more than 256 characters. > The parameter is optional.', example='abcdefg'), ownerId?: long(name='OwnerId'), phoneNumberJson?: string(name='PhoneNumberJson', description='The mobile number of the recipient. Format: * Message delivery to the Chinese mainland: +/+86/0086/86 or an 11-digit mobile number without a prefix. Example: 1590000\\\\*\\\\*\\\\*\\\\*. * Message delivery to countries or regions outside the Chinese mainland: Dialing code + Mobile number. Example: 852000012\\\\*\\\\*\\\\*\\\\*. > We recommend that you call the SendSms operation to send verification codes. This parameter is required.', example='["1590000****","1350000****"]'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signNameJson?: string(name='SignNameJson', description='The signature. Log on to the Alibaba Cloud SMS console. In the left-side navigation pane, click **Go Globe** or **Go China**. You can view the signature in the **Signature** column on the **Signatures** tab. > The signatures must be approved and correspond to the mobile numbers in sequence. This parameter is required.', example='["Aliyun","Alibaba"]'), smsUpExtendCodeJson?: string(name='SmsUpExtendCodeJson', description='The extension code of the MO message. Format: JSON array. > The parameter is optional.', example='["90999","90998"]'), templateCode?: string(name='TemplateCode', description='The code of the message template. Log on to the Alibaba Cloud SMS console. In the left-side navigation pane, click **Go Globe** or **Go China**. You can view the message template in the **Template Code** column on the **Message Templates** tab. > The message templates must be created on the Go Globe page and approved. This parameter is required.', example='SMS_15255****'), templateParamJson?: string(name='TemplateParamJson', description='The value of the variable in the message template. > If you need to add line breaks to the JSON template, make sure that the format is valid. In addition, the sequence of variable values must be the same as that of the mobile numbers and signatures.', example='[{"name":"TemplateParamJson"},{"name":"TemplateParamJson"}]'), } model SendBatchSmsResponseBody = { bizId?: string(name='BizId', description='The ID of the delivery receipt. You can use one of the following methods to query the delivery status of a message based on the ID. * Call the [QuerySendDetails](https://help.aliyun.com/document_detail/102352.html) operation. * Log on to the [Alibaba Cloud SMS console](https://dysms.console.aliyun.com/dysms.htm#/overview). In the left-side navigation pane, choose **Analytics** > **Delivery Report**.', example='9006197469364984400'), code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8D230E'), } model SendBatchSmsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SendBatchSmsResponseBody(name='body'), } /** * @summary Uses a single message template and multiple signatures to send messages to multiple recipients. * * @description You can call the operation to send messages to a maximum of 100 recipients at a time. * * @param request SendBatchSmsRequest * @param runtime runtime options for this request RuntimeOptions * @return SendBatchSmsResponse */ async function sendBatchSmsWithOptions(request: SendBatchSmsRequest, runtime: Util.RuntimeOptions): SendBatchSmsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } var body : map[string]any = {}; if (!Util.isUnset(request.phoneNumberJson)) { body['PhoneNumberJson'] = request.phoneNumberJson; } if (!Util.isUnset(request.signNameJson)) { body['SignNameJson'] = request.signNameJson; } if (!Util.isUnset(request.smsUpExtendCodeJson)) { body['SmsUpExtendCodeJson'] = request.smsUpExtendCodeJson; } if (!Util.isUnset(request.templateParamJson)) { body['TemplateParamJson'] = request.templateParamJson; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), body = OpenApiUtil.parseToMap(body), }; var params = new OpenApi.Params{ action = 'SendBatchSms', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Uses a single message template and multiple signatures to send messages to multiple recipients. * * @description You can call the operation to send messages to a maximum of 100 recipients at a time. * * @param request SendBatchSmsRequest * @return SendBatchSmsResponse */ async function sendBatchSms(request: SendBatchSmsRequest): SendBatchSmsResponse { var runtime = new Util.RuntimeOptions{}; return sendBatchSmsWithOptions(request, runtime); } model SendCardSmsRequest { cardObjects?: [ { customUrl?: string(name='customUrl', description='The URL to which the message is redirected if the message fails to be rendered.', example='https://alibaba.com'), dyncParams?: string(name='dyncParams', description='The variables. Special characters, such as $ and {}, do not need to be entered.', example='{\\\\"param3\\\\":\\\\"three\\\\",\\\\"param1\\\\":\\\\"one\\\\",\\\\"param2\\\\":\\\\"two\\\\"}'), mobile?: string(name='mobile', description='The mobile phone number.', example='1390000****'), } ](name='CardObjects', description='The objects of the message template. This parameter is required.'), cardTemplateCode?: string(name='CardTemplateCode', description='The code of the message template. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. This parameter is required.', example='CARD_SMS_70'), digitalTemplateCode?: string(name='DigitalTemplateCode', description='The code of the digital message template that applies when the card message is rolled back. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved.', example='SMS_003'), digitalTemplateParam?: string(name='DigitalTemplateParam', description='The variables of the digital message template. > If you need to add line breaks to the JSON template, make sure that the format is valid.', example='{\\\\"msg\\\\",\\\\"xxxd\\\\"}'), fallbackType?: string(name='FallbackType', description='The rollback type. Valid values: * **SMS**: text message * **DIGITALSMS**: digital message * **NONE**: none This parameter is required.', example='SMS'), outId?: string(name='OutId', description='The ID that is reserved for the caller of the operation.', example='38d76c9b-4a9a-4c89-afae-61fd8e0e****'), signName?: string(name='SignName', description='The signature. You can view the template code in the **Signature** column on the **Signaturess** tab of the **Go China** page in the Alibaba Cloud SMS console. > The signature must be approved. This parameter is required.', example='aliyun'), smsTemplateCode?: string(name='SmsTemplateCode', description='The code of the text message template that applies when the card message is rolled back. You can view the template code in the **Template Code** column on the **Templates** tab of the **Go China** page in the Alibaba Cloud SMS console. > Make sure that the message template has been approved. If you set the **FallbackType** parameter to **SMS**, this parameter is required.', example='SIER_TEST_01'), smsTemplateParam?: string(name='SmsTemplateParam', description='The variables of the text message template. > If you need to add line breaks to the JSON template, make sure that the format is valid.', example='{\\\\"uri\\\\":\\\\"Zg11tZ\\\\"}'), smsUpExtendCode?: string(name='SmsUpExtendCode', description='The extension code of the upstream message. Upstream messages are messages sent to the communication service provider. Upstream messages are used to customize a service, complete an inquiry, or send a request. You are charged for sending upstream messages based on the billing standards of the service provider. > If you do not need upstream messages, ignore this parameter.', example='1'), templateCode?: string(name='TemplateCode', description='The code of the text message template. Log on to the Alibaba Cloud SMS console. In the left-side navigation pane, click **Go Globe** or **Go China**. You can view the message template in the **Template Code** column on the **Message Templates** tab. > The message templates must be created on the Go Globe page and approved.', example='SMS_2322****'), templateParam?: string(name='TemplateParam', description='The variables of the message template. Format: JSON. > If you need to add line breaks to the JSON template, make sure that the format is valid.', example='{ \\\\"code\\\\": \\\\"1111\\\\" }'), } model SendCardSmsResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: { bizCardId?: string(name='BizCardId', description='The ID of the card message.', example='123'), bizDigitalId?: string(name='BizDigitalId', description='The ID of the digital message.', example='232'), bizSmsId?: string(name='BizSmsId', description='The ID of the text message.', example='524'), cardTmpState?: int32(name='CardTmpState', description='The review status of the card message template. * **0**: pending approval * **1**: approved * **2**: rejected > Unapproved card messages are rolled back.', example='0'), mediaMobiles?: string(name='MediaMobiles', description='The mobile phone number from which the card message is sent.', example='1390000****'), notMediaMobiles?: string(name='NotMediaMobiles', description='The mobile phone number whose card message is rolled back.', example='1390000****'), }(name='Data', description='The data returned.'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8D28D0'), success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values: * **true** * **false**', example='true'), } model SendCardSmsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SendCardSmsResponseBody(name='body'), } /** * @summary Sends a card message. * * @description * Make sure that the message template that you want to use has been approved. If the mobile phone number of a recipient does not support card messages, the SendCardSms operation allows the rollback feature to ensure successful delivery. * * When you call the SendCardSms operation to send card messages, the operation checks whether the mobile phone numbers of the recipients support card messages. If the mobile phone numbers do not support card messages, you can specify whether to enable rollback. Otherwise, the card message cannot be delivered. * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request SendCardSmsRequest * @param runtime runtime options for this request RuntimeOptions * @return SendCardSmsResponse */ async function sendCardSmsWithOptions(request: SendCardSmsRequest, runtime: Util.RuntimeOptions): SendCardSmsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.cardObjects)) { query['CardObjects'] = request.cardObjects; } if (!Util.isUnset(request.cardTemplateCode)) { query['CardTemplateCode'] = request.cardTemplateCode; } if (!Util.isUnset(request.digitalTemplateCode)) { query['DigitalTemplateCode'] = request.digitalTemplateCode; } if (!Util.isUnset(request.digitalTemplateParam)) { query['DigitalTemplateParam'] = request.digitalTemplateParam; } if (!Util.isUnset(request.fallbackType)) { query['FallbackType'] = request.fallbackType; } if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.smsTemplateCode)) { query['SmsTemplateCode'] = request.smsTemplateCode; } if (!Util.isUnset(request.smsTemplateParam)) { query['SmsTemplateParam'] = request.smsTemplateParam; } if (!Util.isUnset(request.smsUpExtendCode)) { query['SmsUpExtendCode'] = request.smsUpExtendCode; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } if (!Util.isUnset(request.templateParam)) { query['TemplateParam'] = request.templateParam; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'SendCardSms', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Sends a card message. * * @description * Make sure that the message template that you want to use has been approved. If the mobile phone number of a recipient does not support card messages, the SendCardSms operation allows the rollback feature to ensure successful delivery. * * When you call the SendCardSms operation to send card messages, the operation checks whether the mobile phone numbers of the recipients support card messages. If the mobile phone numbers do not support card messages, you can specify whether to enable rollback. Otherwise, the card message cannot be delivered. * ### QPS limit * You can call this operation up to 1,000 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request SendCardSmsRequest * @return SendCardSmsResponse */ async function sendCardSms(request: SendCardSmsRequest): SendCardSmsResponse { var runtime = new Util.RuntimeOptions{}; return sendCardSmsWithOptions(request, runtime); } model SendSmsRequest { outId?: string(name='OutId', description='The extension field. > You can ignore this parameter if you do not have special requirements.', example='abcdefgh'), ownerId?: long(name='OwnerId'), phoneNumbers?: string(name='PhoneNumbers', description='The mobile numbers of the recipients. Format: * If you send messages to the Chinese mainland, specify mobile numbers that are prefixed with +, +86, 0086, or 86, or 11-digit mobile numbers without prefixes. Example: 1390000\\\\*\\\\*\\\\*\\\\*. * If you send messages to countries or regions outside the Chinese mainland, specify this parameter in the \\\\<Area code>\\\\<Mobile number> format. Example: 852000012\\\\*\\\\*\\\\*\\\\*. You can send messages to multiple mobile numbers, separate the mobile numbers with commas (,). You can specify up to 1,000 mobile numbers in each request. Compared with sending messages to a single mobile number, sending messages to multiple mobile numbers requires longer response time. > We recommend that you send one verification code message to a mobile number in each request. This parameter is required.', example='1390000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='The signature. You can log on to the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm?spm=5176.12818093.categories-n-products.ddysms.3b2816d0xml2NA#/overview), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the signature on the **Signatures** tab. > You must specify a signature that is created in the SMS console and approved by Alibaba Cloud. For more information about SMS signature specifications, see [SMS signature specifications](https://help.aliyun.com/document_detail/108076.html). This parameter is required.', example='Aliyun'), smsUpExtendCode?: string(name='SmsUpExtendCode', description='The extension code of the upstream message. Upstream messages are messages sent to the communication service provider. Upstream messages are used to customize a service, complete an inquiry, or send a request. You are charged for sending upstream messages based on the billing standards of the service provider. > The extension code is automatically generated by the system when the signature is generated. You do not need to specify the extension code. You can ignore this parameter if you do not have special requirements.', example='90999'), templateCode?: string(name='TemplateCode', description='The code of the message template. You can log on to the [Short Message Service (SMS) console](https://dysms.console.aliyun.com/dysms.htm?spm=5176.12818093.categories-n-products.ddysms.3b2816d0xml2NA#/overview), click **Go China** or **Go Globe** in the left-side navigation pane, and then view the **template code** on the **Templates** tab. > You must specify a message template that is created in the SMS console and approved by Alibaba Cloud. If you send messages to countries or regions outside the Chinese mainland, use the corresponding message templates. This parameter is required.', example='SMS_15305****'), templateParam?: string(name='TemplateParam', description='The value of the variable in the message template. You can specify multiple parameter values. Example:{"name":"Sam","number":"1390000\\\\*\\\\*\\\\*\\\\*"}. > * If line breaks are required in JSON-formatted data, they must meet the relevant requirements that are specified in the standard JSON protocol. * For more information about template variables, see [SMS template specifications](https://help.aliyun.com/document_detail/108253.html).', example='{"code":"1111"}'), } model SendSmsResponseBody = { bizId?: string(name='BizId', description='The ID of the delivery receipt. You can call the [QuerySendDetails](~~QuerySendDetails~~) operation to query the delivery status based on the receipt ID.', example='9006197469364984****'), code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8DE990'), } model SendSmsResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SendSmsResponseBody(name='body'), } /** * @summary Sends a message. Before you call this operation, submit a message signature and message template, and make sure that the signature and template are approved. * * @description * This operation is mainly used to send a single message. In special scenarios, you can send multiple messages with the same content to a maximum of 1,000 mobile numbers. Note that group sending may be delayed. * * To send messages with different signatures and template content to multiple mobile numbers in a single request, call the [SendBatchSms](https://help.aliyun.com/document_detail/102364.html) operation. * * You are charged for using Alibaba Cloud Short Message Service (SMS) based on the amount of messages sent. For more information, see [Pricing](https://www.aliyun.com/price/product#/sms/detail). * * If your verification code signature and general-purpose signature have the same name, the system uses the general-purpose signature to send messages by default. * * @param request SendSmsRequest * @param runtime runtime options for this request RuntimeOptions * @return SendSmsResponse */ async function sendSmsWithOptions(request: SendSmsRequest, runtime: Util.RuntimeOptions): SendSmsResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.outId)) { query['OutId'] = request.outId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.phoneNumbers)) { query['PhoneNumbers'] = request.phoneNumbers; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.smsUpExtendCode)) { query['SmsUpExtendCode'] = request.smsUpExtendCode; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } if (!Util.isUnset(request.templateParam)) { query['TemplateParam'] = request.templateParam; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'SendSms', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Sends a message. Before you call this operation, submit a message signature and message template, and make sure that the signature and template are approved. * * @description * This operation is mainly used to send a single message. In special scenarios, you can send multiple messages with the same content to a maximum of 1,000 mobile numbers. Note that group sending may be delayed. * * To send messages with different signatures and template content to multiple mobile numbers in a single request, call the [SendBatchSms](https://help.aliyun.com/document_detail/102364.html) operation. * * You are charged for using Alibaba Cloud Short Message Service (SMS) based on the amount of messages sent. For more information, see [Pricing](https://www.aliyun.com/price/product#/sms/detail). * * If your verification code signature and general-purpose signature have the same name, the system uses the general-purpose signature to send messages by default. * * @param request SendSmsRequest * @return SendSmsResponse */ async function sendSms(request: SendSmsRequest): SendSmsResponse { var runtime = new Util.RuntimeOptions{}; return sendSmsWithOptions(request, runtime); } model SmsConversionIntlRequest { conversionTime?: long(name='ConversionTime', description='The time when the OTP message was delivered. The value is a UNIX timestamp. Unit: milliseconds. * If you leave the parameter empty, the current timestamp is specified by default. * If you specify the parameter, the timestamp must be greater than the message sending time and less than the current timestamp.', example='1349055900000'), delivered?: boolean(name='Delivered', description='Specifies whether customers replied to the OTP message. Valid values: true and false. This parameter is required.', example='true'), messageId?: string(name='MessageId', description='The ID of the message. This parameter is required.', example='1008030300****'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model SmsConversionIntlResponseBody = { code?: string(name='Code', description='The response code. If OK is returned, the request is successful. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html?spm=a2c4g.101345.0.0.74326ff2J5EZyt).', example='OK'), message?: string(name='Message', description='The returned message.', example='OK'), requestId?: string(name='RequestId', description='The request ID.', example='F655A8D5-B967-440B-8683-DAD6FF8D****'), } model SmsConversionIntlResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SmsConversionIntlResponseBody(name='body'), } /** * @summary Reports the status of an OTP message to Alibaba Cloud SMS. * * @description Metrics: * * Requested OTP messages * * Verified OTP messages * An OTP conversion rate is calculated based on the following formula: OTP conversion rate = Number of verified OTP messages/Number of requested OTP messages. * > If you call the SmsConversion operation to query OTP conversion rates, your business may be affected. We recommend that you perform the following operations: 1. Call the SmsConversion operation in an asynchronous manner by configuring queues or events. 2. Manually degrade your services or use a circuit breaker to automatically degrade services. * * @param request SmsConversionIntlRequest * @param runtime runtime options for this request RuntimeOptions * @return SmsConversionIntlResponse */ async function smsConversionIntlWithOptions(request: SmsConversionIntlRequest, runtime: Util.RuntimeOptions): SmsConversionIntlResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.conversionTime)) { query['ConversionTime'] = request.conversionTime; } if (!Util.isUnset(request.delivered)) { query['Delivered'] = request.delivered; } if (!Util.isUnset(request.messageId)) { query['MessageId'] = request.messageId; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'SmsConversionIntl', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Reports the status of an OTP message to Alibaba Cloud SMS. * * @description Metrics: * * Requested OTP messages * * Verified OTP messages * An OTP conversion rate is calculated based on the following formula: OTP conversion rate = Number of verified OTP messages/Number of requested OTP messages. * > If you call the SmsConversion operation to query OTP conversion rates, your business may be affected. We recommend that you perform the following operations: 1. Call the SmsConversion operation in an asynchronous manner by configuring queues or events. 2. Manually degrade your services or use a circuit breaker to automatically degrade services. * * @param request SmsConversionIntlRequest * @return SmsConversionIntlResponse */ async function smsConversionIntl(request: SmsConversionIntlRequest): SmsConversionIntlResponse { var runtime = new Util.RuntimeOptions{}; return smsConversionIntlWithOptions(request, runtime); } model SubmitSmsQualificationRequest { adminIDCardExpDate?: string(name='AdminIDCardExpDate', description='经办人身份证有效期,格式示例2023-01-01~2033-01-01 This parameter is required.', example='2023-01-01~2033-01-01'), adminIDCardFrontFace?: string(name='AdminIDCardFrontFace', description='经办人身份证照片国徽面 This parameter is required.', example='123456/111.png'), adminIDCardNo?: string(name='AdminIDCardNo', description='经办人身份证号码 This parameter is required.', example='511391********5123'), adminIDCardPic?: string(name='AdminIDCardPic', description='经办人身份证照片人像面 This parameter is required.', example='123456/111.png'), adminIDCardType?: string(name='AdminIDCardType', description='管理员身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他 This parameter is required.', example='identityCard'), adminName?: string(name='AdminName', description='经办人姓名 This parameter is required.', example='示例值示例值'), adminPhoneNo?: string(name='AdminPhoneNo', description='经办人手机号码 This parameter is required.', example='137****1234'), businessLicensePics?: [ { licensePic?: string(name='LicensePic', description='营业证件图片标识的osskey', example='123456/111.png'), type?: string(name='Type', description='营业证件类型,businessLicense:营业执照;organizationCodeLicense:组织机构代码证;taxRegistrationLicense:税务登记证;socialCreditLicense:社会信用代码证书;newStyleBusinessLicense:三证合一;signLegalLicense:签名归属方的事业单位法人证书;otherLicense:其他类型执照证书', example='businessLicense'), } ](name='BusinessLicensePics', description='企业营业证件信息,非大客户必填'), bussinessLicenseExpDate?: string(name='BussinessLicenseExpDate', description='企业营业时间开始和结束字符串,格式示例2023-01-01~2033-01-01 This parameter is required.', example='2023-01-01~2033-01-01'), certifyCode?: string(name='CertifyCode', description='手机号验证码 This parameter is required.', example='1234'), companyName?: string(name='CompanyName', description='公司名称 This parameter is required.', example='示例值示例值'), companyType?: string(name='CompanyType', description='企业类型, COMPANY:公司;NON_PROFIT_ORGANIZATION:政府或者事业单位 This parameter is required.', example='COMPANY'), legalPersonIDCardNo?: string(name='LegalPersonIDCardNo', description='法人身份证号码 This parameter is required.', example='511391********5123'), legalPersonIDCardType?: string(name='LegalPersonIDCardType', description='法人身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他 This parameter is required.', example='identityCard'), legalPersonIdCardBackSide?: string(name='LegalPersonIdCardBackSide', description='法人身份证照片人像面', example='123456/111.png'), legalPersonIdCardEffTime?: string(name='LegalPersonIdCardEffTime', description='法人身份证有效期 This parameter is required.', example='2023-01-01~2033-01-01'), legalPersonIdCardFrontSide?: string(name='LegalPersonIdCardFrontSide', description='法人身份证照片国徽面', example='123456/111.png'), legalPersonName?: string(name='LegalPersonName', description='法人姓名 This parameter is required.', example='示例值示例值'), organizationCode?: string(name='OrganizationCode', description='社会统一信用代码 This parameter is required.', example='910X********0012'), otherFiles?: [ { licensePic?: string(name='LicensePic', example='123456/111.png'), } ](name='OtherFiles', description='更多资料'), ownerId?: long(name='OwnerId'), qualificationName?: string(name='QualificationName', description='资质名称,名称不能重复 This parameter is required.', example='示例值示例值示例值'), remark?: string(name='Remark', description='备注', example='示例值示例值'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), useBySelf?: boolean(name='UseBySelf', description='资质是自用还是他用,true:自用,false:他用 This parameter is required.', example='true'), whetherShare?: boolean(name='WhetherShare', description='是否同意与其他业务线共享 This parameter is required.', example='false'), } model SubmitSmsQualificationShrinkRequest { adminIDCardExpDate?: string(name='AdminIDCardExpDate', description='经办人身份证有效期,格式示例2023-01-01~2033-01-01 This parameter is required.', example='2023-01-01~2033-01-01'), adminIDCardFrontFace?: string(name='AdminIDCardFrontFace', description='经办人身份证照片国徽面 This parameter is required.', example='123456/111.png'), adminIDCardNo?: string(name='AdminIDCardNo', description='经办人身份证号码 This parameter is required.', example='511391********5123'), adminIDCardPic?: string(name='AdminIDCardPic', description='经办人身份证照片人像面 This parameter is required.', example='123456/111.png'), adminIDCardType?: string(name='AdminIDCardType', description='管理员身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他 This parameter is required.', example='identityCard'), adminName?: string(name='AdminName', description='经办人姓名 This parameter is required.', example='示例值示例值'), adminPhoneNo?: string(name='AdminPhoneNo', description='经办人手机号码 This parameter is required.', example='137****1234'), businessLicensePicsShrink?: string(name='BusinessLicensePics', description='企业营业证件信息,非大客户必填'), bussinessLicenseExpDate?: string(name='BussinessLicenseExpDate', description='企业营业时间开始和结束字符串,格式示例2023-01-01~2033-01-01 This parameter is required.', example='2023-01-01~2033-01-01'), certifyCode?: string(name='CertifyCode', description='手机号验证码 This parameter is required.', example='1234'), companyName?: string(name='CompanyName', description='公司名称 This parameter is required.', example='示例值示例值'), companyType?: string(name='CompanyType', description='企业类型, COMPANY:公司;NON_PROFIT_ORGANIZATION:政府或者事业单位 This parameter is required.', example='COMPANY'), legalPersonIDCardNo?: string(name='LegalPersonIDCardNo', description='法人身份证号码 This parameter is required.', example='511391********5123'), legalPersonIDCardType?: string(name='LegalPersonIDCardType', description='法人身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他 This parameter is required.', example='identityCard'), legalPersonIdCardBackSide?: string(name='LegalPersonIdCardBackSide', description='法人身份证照片人像面', example='123456/111.png'), legalPersonIdCardEffTime?: string(name='LegalPersonIdCardEffTime', description='法人身份证有效期 This parameter is required.', example='2023-01-01~2033-01-01'), legalPersonIdCardFrontSide?: string(name='LegalPersonIdCardFrontSide', description='法人身份证照片国徽面', example='123456/111.png'), legalPersonName?: string(name='LegalPersonName', description='法人姓名 This parameter is required.', example='示例值示例值'), organizationCode?: string(name='OrganizationCode', description='社会统一信用代码 This parameter is required.', example='910X********0012'), otherFilesShrink?: string(name='OtherFiles', description='更多资料'), ownerId?: long(name='OwnerId'), qualificationName?: string(name='QualificationName', description='资质名称,名称不能重复 This parameter is required.', example='示例值示例值示例值'), remark?: string(name='Remark', description='备注', example='示例值示例值'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), useBySelf?: boolean(name='UseBySelf', description='资质是自用还是他用,true:自用,false:他用 This parameter is required.', example='true'), whetherShare?: boolean(name='WhetherShare', description='是否同意与其他业务线共享 This parameter is required.', example='false'), } model SubmitSmsQualificationResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: string(name='Data', example='1000****'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model SubmitSmsQualificationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: SubmitSmsQualificationResponseBody(name='body'), } /** * @summary 创建资质对客openAPI * * @param tmpReq SubmitSmsQualificationRequest * @param runtime runtime options for this request RuntimeOptions * @return SubmitSmsQualificationResponse */ async function submitSmsQualificationWithOptions(tmpReq: SubmitSmsQualificationRequest, runtime: Util.RuntimeOptions): SubmitSmsQualificationResponse { Util.validateModel(tmpReq); var request = new SubmitSmsQualificationShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.businessLicensePics)) { request.businessLicensePicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.businessLicensePics, 'BusinessLicensePics', 'json'); } if (!Util.isUnset(tmpReq.otherFiles)) { request.otherFilesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otherFiles, 'OtherFiles', 'json'); } var query = {}; if (!Util.isUnset(request.adminIDCardExpDate)) { query['AdminIDCardExpDate'] = request.adminIDCardExpDate; } if (!Util.isUnset(request.adminIDCardFrontFace)) { query['AdminIDCardFrontFace'] = request.adminIDCardFrontFace; } if (!Util.isUnset(request.adminIDCardNo)) { query['AdminIDCardNo'] = request.adminIDCardNo; } if (!Util.isUnset(request.adminIDCardPic)) { query['AdminIDCardPic'] = request.adminIDCardPic; } if (!Util.isUnset(request.adminIDCardType)) { query['AdminIDCardType'] = request.adminIDCardType; } if (!Util.isUnset(request.adminName)) { query['AdminName'] = request.adminName; } if (!Util.isUnset(request.adminPhoneNo)) { query['AdminPhoneNo'] = request.adminPhoneNo; } if (!Util.isUnset(request.businessLicensePicsShrink)) { query['BusinessLicensePics'] = request.businessLicensePicsShrink; } if (!Util.isUnset(request.bussinessLicenseExpDate)) { query['BussinessLicenseExpDate'] = request.bussinessLicenseExpDate; } if (!Util.isUnset(request.certifyCode)) { query['CertifyCode'] = request.certifyCode; } if (!Util.isUnset(request.companyName)) { query['CompanyName'] = request.companyName; } if (!Util.isUnset(request.companyType)) { query['CompanyType'] = request.companyType; } if (!Util.isUnset(request.legalPersonIDCardNo)) { query['LegalPersonIDCardNo'] = request.legalPersonIDCardNo; } if (!Util.isUnset(request.legalPersonIDCardType)) { query['LegalPersonIDCardType'] = request.legalPersonIDCardType; } if (!Util.isUnset(request.legalPersonIdCardBackSide)) { query['LegalPersonIdCardBackSide'] = request.legalPersonIdCardBackSide; } if (!Util.isUnset(request.legalPersonIdCardEffTime)) { query['LegalPersonIdCardEffTime'] = request.legalPersonIdCardEffTime; } if (!Util.isUnset(request.legalPersonIdCardFrontSide)) { query['LegalPersonIdCardFrontSide'] = request.legalPersonIdCardFrontSide; } if (!Util.isUnset(request.legalPersonName)) { query['LegalPersonName'] = request.legalPersonName; } if (!Util.isUnset(request.organizationCode)) { query['OrganizationCode'] = request.organizationCode; } if (!Util.isUnset(request.otherFilesShrink)) { query['OtherFiles'] = request.otherFilesShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationName)) { query['QualificationName'] = request.qualificationName; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.useBySelf)) { query['UseBySelf'] = request.useBySelf; } if (!Util.isUnset(request.whetherShare)) { query['WhetherShare'] = request.whetherShare; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'SubmitSmsQualification', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 创建资质对客openAPI * * @param request SubmitSmsQualificationRequest * @return SubmitSmsQualificationResponse */ async function submitSmsQualification(request: SubmitSmsQualificationRequest): SubmitSmsQualificationResponse { var runtime = new Util.RuntimeOptions{}; return submitSmsQualificationWithOptions(request, runtime); } model TagResourcesRequest { ownerId?: long(name='OwnerId'), prodCode?: string(name='ProdCode', description='The name of the cloud service. Set the value to **dysms**.', example='dysms'), regionId?: string(name='RegionId', description='The region ID. Set the value to **cn-hangzhou**. This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='The code of the message template.', example='SMS_23423423'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to **TEMPLATE**. This parameter is required.', example='TEMPLATE'), tag?: [ { key?: string(name='Key', description='The array of tag keys. Valid values of N: 1 to 20.', example='TestKey'), value?: string(name='Value', description='The array of tag values. Valid values of N: 1 to 20.', example='TestValue'), } ](name='Tag', description='The tag. This parameter is required.'), } model TagResourcesResponseBody = { code?: string(name='Code', description='The response code. * If OK is returned, the request is successful. * Other values indicate that the request fails. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: string(name='Data', description='Indicates whether tags were attached. Valid values: * **true** * **false**', example='true'), requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C****'), } model TagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: TagResourcesResponseBody(name='body'), } /** * @summary Attaches tags to a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request TagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return TagResourcesResponse */ async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.prodCode)) { query['ProdCode'] = request.prodCode; } if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tag)) { query['Tag'] = request.tag; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'TagResources', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Attaches tags to a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request TagResourcesRequest * @return TagResourcesResponse */ async function tagResources(request: TagResourcesRequest): TagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return tagResourcesWithOptions(request, runtime); } model UntagResourcesRequest { all?: boolean(name='All', description='Specifies whether to delete all tags from the message template. Valid values: * **true** * **false**', example='false'), ownerId?: long(name='OwnerId'), prodCode?: string(name='ProdCode', description='The name of the cloud service. Set the value to **dysms**.', example='dysms'), regionId?: string(name='RegionId', description='The region. Set the value to cn-hangzhou. This parameter is required.', example='cn-hangzhou'), resourceId?: [ string ](name='ResourceId', description='The array of message template codes. You can specify 1 to 20 message templates.', example='SMS_23423423'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), resourceType?: string(name='ResourceType', description='The type of the resource. Set the value to TEMPLATE. This parameter is required.', example='TEMPLATE'), tagKey?: [ string ](name='TagKey', description='The array of tag keys. You can specify 1 to 20 tag keys.', example='TestKey'), } model UntagResourcesResponseBody = { code?: string(name='Code', description='The HTTP status code. * The value OK indicates that the request was successful. * Other values indicate that the request failed. For more information, see [Error codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), data?: string(name='Data', description='Indicates whether the request is successful. Valid values: * **true** * **false**', example='true'), requestId?: string(name='RequestId', description='The request ID.', example='A90E4451-FED7-49D2-87C8-00700A8C****'), } model UntagResourcesResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UntagResourcesResponseBody(name='body'), } /** * @summary Deletes tags from a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request UntagResourcesRequest * @param runtime runtime options for this request RuntimeOptions * @return UntagResourcesResponse */ async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.all)) { query['All'] = request.all; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.prodCode)) { query['ProdCode'] = request.prodCode; } if (!Util.isUnset(request.regionId)) { query['RegionId'] = request.regionId; } if (!Util.isUnset(request.resourceId)) { query['ResourceId'] = request.resourceId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.resourceType)) { query['ResourceType'] = request.resourceType; } if (!Util.isUnset(request.tagKey)) { query['TagKey'] = request.tagKey; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UntagResources', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Deletes tags from a message template. * * @description ### QPS limit * You can call this operation up to 50 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. * * @param request UntagResourcesRequest * @return UntagResourcesResponse */ async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse { var runtime = new Util.RuntimeOptions{}; return untagResourcesWithOptions(request, runtime); } model UpdateExtCodeSignRequest { existExtCode?: string(name='ExistExtCode', description='要修改的扩展码A3 This parameter is required.', example='01'), newExtCode?: string(name='NewExtCode', description='修改后的扩展码A3 This parameter is required.', example='02'), ownerId?: long(name='OwnerId'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='签名 This parameter is required.', example='示例值示例值示例值'), } model UpdateExtCodeSignResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: boolean(name='Data', example='false'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model UpdateExtCodeSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateExtCodeSignResponseBody(name='body'), } /** * @summary 修改验证码签名 * * @param request UpdateExtCodeSignRequest * @param runtime runtime options for this request RuntimeOptions * @return UpdateExtCodeSignResponse */ async function updateExtCodeSignWithOptions(request: UpdateExtCodeSignRequest, runtime: Util.RuntimeOptions): UpdateExtCodeSignResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.existExtCode)) { query['ExistExtCode'] = request.existExtCode; } if (!Util.isUnset(request.newExtCode)) { query['NewExtCode'] = request.newExtCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UpdateExtCodeSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 修改验证码签名 * * @param request UpdateExtCodeSignRequest * @return UpdateExtCodeSignResponse */ async function updateExtCodeSign(request: UpdateExtCodeSignRequest): UpdateExtCodeSignResponse { var runtime = new Util.RuntimeOptions{}; return updateExtCodeSignWithOptions(request, runtime); } model UpdateSmsQualificationRequest { adminIDCardExpDate?: string(name='AdminIDCardExpDate', description='经办人身份证有效期,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), adminIDCardFrontFace?: string(name='AdminIDCardFrontFace', description='经办人身份证照片国徽面', example='123456/111.png'), adminIDCardNo?: string(name='AdminIDCardNo', description='经办人身份证号码', example='511391********5123'), adminIDCardPic?: string(name='AdminIDCardPic', description='经办人身份证照片人像面', example='123456/111.png'), adminIDCardType?: string(name='AdminIDCardType', description='管理员身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他', example='identityCard'), adminName?: string(name='AdminName', description='经办人姓名', example='示例值'), adminPhoneNo?: string(name='AdminPhoneNo', description='经办人手机号码 This parameter is required.', example='137********'), businessLicensePics?: [ { licensePic?: string(name='LicensePic', description='证件图片标识的osskey', example='123456/111.png'), type?: string(name='Type', description='企业证件类型,businessLicense:营业执照;organizationCodeLicense:组织机构代码证;taxRegistrationLicense:税务登记证;socialCreditLicense:社会信用代码证书;newStyleBusinessLicense:三证合一;signLegalLicense:签名归属方的事业单位法人证书;otherLicense:其他类型执照证书', example='businessLicense'), } ](name='BusinessLicensePics', description='企业证件信息'), bussinessLicenseExpDate?: string(name='BussinessLicenseExpDate', description='企业营业时间开始和结束字符串,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), certifyCode?: string(name='CertifyCode', description='手机号验证码 This parameter is required.', example='1234'), companyName?: string(name='CompanyName', description='公司名称', example='示例值示例值示例值'), legalPersonIDCardNo?: string(name='LegalPersonIDCardNo', description='法人身份证号码', example='511391********5123'), legalPersonIDCardType?: string(name='LegalPersonIDCardType', description='法人身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他', example='identityCard'), legalPersonIdCardBackSide?: string(name='LegalPersonIdCardBackSide', description='法人身份证照片人像面', example='123456/111.png'), legalPersonIdCardEffTime?: string(name='LegalPersonIdCardEffTime', description='法人身份证有效期,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), legalPersonIdCardFrontSide?: string(name='LegalPersonIdCardFrontSide', description='法人身份照片证国徽面', example='123456/111.png'), legalPersonName?: string(name='LegalPersonName', description='法人姓名', example='示例值示例值'), orderId?: long(name='OrderId', description='工单ID This parameter is required.', example='2001*****'), otherFiles?: [ { licensePic?: string(name='LicensePic', example='123456/111.png'), } ](name='OtherFiles', description='更多资料'), ownerId?: long(name='OwnerId'), qualificationGroupId?: long(name='QualificationGroupId', description='资质组ID This parameter is required.', example='10000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model UpdateSmsQualificationShrinkRequest { adminIDCardExpDate?: string(name='AdminIDCardExpDate', description='经办人身份证有效期,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), adminIDCardFrontFace?: string(name='AdminIDCardFrontFace', description='经办人身份证照片国徽面', example='123456/111.png'), adminIDCardNo?: string(name='AdminIDCardNo', description='经办人身份证号码', example='511391********5123'), adminIDCardPic?: string(name='AdminIDCardPic', description='经办人身份证照片人像面', example='123456/111.png'), adminIDCardType?: string(name='AdminIDCardType', description='管理员身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他', example='identityCard'), adminName?: string(name='AdminName', description='经办人姓名', example='示例值'), adminPhoneNo?: string(name='AdminPhoneNo', description='经办人手机号码 This parameter is required.', example='137********'), businessLicensePicsShrink?: string(name='BusinessLicensePics', description='企业证件信息'), bussinessLicenseExpDate?: string(name='BussinessLicenseExpDate', description='企业营业时间开始和结束字符串,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), certifyCode?: string(name='CertifyCode', description='手机号验证码 This parameter is required.', example='1234'), companyName?: string(name='CompanyName', description='公司名称', example='示例值示例值示例值'), legalPersonIDCardNo?: string(name='LegalPersonIDCardNo', description='法人身份证号码', example='511391********5123'), legalPersonIDCardType?: string(name='LegalPersonIDCardType', description='法人身份证类型。identityCard:中国居民身份证;passport:护照;homeReturnPermit:港澳居民来往内地通行证;TaiwanCompatriotPermit:台湾居民来往大陆通行证;residencePermit:港澳台居民居住证";other:其他', example='identityCard'), legalPersonIdCardBackSide?: string(name='LegalPersonIdCardBackSide', description='法人身份证照片人像面', example='123456/111.png'), legalPersonIdCardEffTime?: string(name='LegalPersonIdCardEffTime', description='法人身份证有效期,格式示例2023-01-01~2033-01-01', example='2023-01-01~2033-01-01'), legalPersonIdCardFrontSide?: string(name='LegalPersonIdCardFrontSide', description='法人身份照片证国徽面', example='123456/111.png'), legalPersonName?: string(name='LegalPersonName', description='法人姓名', example='示例值示例值'), orderId?: long(name='OrderId', description='工单ID This parameter is required.', example='2001*****'), otherFilesShrink?: string(name='OtherFiles', description='更多资料'), ownerId?: long(name='OwnerId'), qualificationGroupId?: long(name='QualificationGroupId', description='资质组ID This parameter is required.', example='10000****'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model UpdateSmsQualificationResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: string(name='Data', example='10000****'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='25D5AFDE-8EBC-132E-8909-1FDC071DA'), success?: boolean(name='Success', example='true'), } model UpdateSmsQualificationResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateSmsQualificationResponseBody(name='body'), } /** * @summary 修改资质对客openAPI * * @param tmpReq UpdateSmsQualificationRequest * @param runtime runtime options for this request RuntimeOptions * @return UpdateSmsQualificationResponse */ async function updateSmsQualificationWithOptions(tmpReq: UpdateSmsQualificationRequest, runtime: Util.RuntimeOptions): UpdateSmsQualificationResponse { Util.validateModel(tmpReq); var request = new UpdateSmsQualificationShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.businessLicensePics)) { request.businessLicensePicsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.businessLicensePics, 'BusinessLicensePics', 'json'); } if (!Util.isUnset(tmpReq.otherFiles)) { request.otherFilesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.otherFiles, 'OtherFiles', 'json'); } var query = {}; if (!Util.isUnset(request.adminIDCardExpDate)) { query['AdminIDCardExpDate'] = request.adminIDCardExpDate; } if (!Util.isUnset(request.adminIDCardFrontFace)) { query['AdminIDCardFrontFace'] = request.adminIDCardFrontFace; } if (!Util.isUnset(request.adminIDCardNo)) { query['AdminIDCardNo'] = request.adminIDCardNo; } if (!Util.isUnset(request.adminIDCardPic)) { query['AdminIDCardPic'] = request.adminIDCardPic; } if (!Util.isUnset(request.adminIDCardType)) { query['AdminIDCardType'] = request.adminIDCardType; } if (!Util.isUnset(request.adminName)) { query['AdminName'] = request.adminName; } if (!Util.isUnset(request.adminPhoneNo)) { query['AdminPhoneNo'] = request.adminPhoneNo; } if (!Util.isUnset(request.businessLicensePicsShrink)) { query['BusinessLicensePics'] = request.businessLicensePicsShrink; } if (!Util.isUnset(request.bussinessLicenseExpDate)) { query['BussinessLicenseExpDate'] = request.bussinessLicenseExpDate; } if (!Util.isUnset(request.certifyCode)) { query['CertifyCode'] = request.certifyCode; } if (!Util.isUnset(request.companyName)) { query['CompanyName'] = request.companyName; } if (!Util.isUnset(request.legalPersonIDCardNo)) { query['LegalPersonIDCardNo'] = request.legalPersonIDCardNo; } if (!Util.isUnset(request.legalPersonIDCardType)) { query['LegalPersonIDCardType'] = request.legalPersonIDCardType; } if (!Util.isUnset(request.legalPersonIdCardBackSide)) { query['LegalPersonIdCardBackSide'] = request.legalPersonIdCardBackSide; } if (!Util.isUnset(request.legalPersonIdCardEffTime)) { query['LegalPersonIdCardEffTime'] = request.legalPersonIdCardEffTime; } if (!Util.isUnset(request.legalPersonIdCardFrontSide)) { query['LegalPersonIdCardFrontSide'] = request.legalPersonIdCardFrontSide; } if (!Util.isUnset(request.legalPersonName)) { query['LegalPersonName'] = request.legalPersonName; } if (!Util.isUnset(request.orderId)) { query['OrderId'] = request.orderId; } if (!Util.isUnset(request.otherFilesShrink)) { query['OtherFiles'] = request.otherFilesShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationGroupId)) { query['QualificationGroupId'] = request.qualificationGroupId; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UpdateSmsQualification', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 修改资质对客openAPI * * @param request UpdateSmsQualificationRequest * @return UpdateSmsQualificationResponse */ async function updateSmsQualification(request: UpdateSmsQualificationRequest): UpdateSmsQualificationResponse { var runtime = new Util.RuntimeOptions{}; return updateSmsQualificationWithOptions(request, runtime); } model UpdateSmsSignRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, please enter the domain name registered with MIIT, including HTTP or HTTPS. - For launched apps, provide the display link from the app store with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, fill in the full name, ensuring they are online. - For e-commerce platform store names (for enterprise users only), provide the display link with HTTP or HTTPS.', example='http://www.aliyun.com/'), authorizationLetterId?: long(name='AuthorizationLetterId'), moreData?: [ string ](name='MoreData', description='Additional materials, such as uploading business proof documents or screenshots of business operations, to help reviewers understand your business details.'), ownerId?: long(name='OwnerId'), qualificationId?: long(name='QualificationId', description='Approved or under-review qualification ID. > - Before applying for an SMS signature, please first [apply for qualifications](https://help.aliyun.com/zh/sms/user-guide/new-qualification?spm=a2c4g.11186623.0.0.718d187bbkpMRK). > - You can view the qualification ID on the [Qualification Management](https://dysms.console.aliyun.com/domestic/text/qualification) page. This parameter is required.', example='8563**'), remark?: string(name='Remark', description='Explanation of the SMS signature scenario, with a maximum length of 200 characters. > The scenario explanation is one of the reference information for signature review. Please provide a detailed description of the usage scenarios of the launched business, along with verifiable information such as website links, registered domain addresses, app store download links, full names of public accounts or mini-programs, etc. For login scenarios, test account credentials are also required. A well-informed application explanation will enhance the efficiency of signature and template reviews. Refer to the **Application Scenarios** column in the [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.i2#section-xup-k46-yi4) table for filling in SMS scenarios.', example='登录场景申请验证码'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='Signature not yet approved. This parameter is required.', example='阿里云验证码'), signSource?: int32(name='SignSource', description='Source of the signature. Values: - **0**: Full name or abbreviation of enterprises and institutions. - **1**: Full name or abbreviation of MIIT-registered websites. - **2**: Full name or abbreviation of app applications. - **3**: Full name or abbreviation of public accounts or mini-programs. - **4**: Full name or abbreviation of e-commerce platform store names. - **5**: Full name or abbreviation of trademarks. This parameter is required.', example='1'), signType?: int32(name='SignType', description='Signature type. It is recommended to use the default value. - **0**: Verification code - **1**: General (default)', example='1'), thirdParty?: boolean(name='ThirdParty', description='Whether the signature is for self-use or others. - false: Self-use - true: Others >Notice: When the signature is for self-use, select the self-use qualification ID; when it\\\\"s for others, choose the others\\\\" qualification ID.', example='false'), } model UpdateSmsSignShrinkRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, please enter the domain name registered with MIIT, including HTTP or HTTPS. - For launched apps, provide the display link from the app store with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, fill in the full name, ensuring they are online. - For e-commerce platform store names (for enterprise users only), provide the display link with HTTP or HTTPS.', example='http://www.aliyun.com/'), authorizationLetterId?: long(name='AuthorizationLetterId'), moreDataShrink?: string(name='MoreData', description='Additional materials, such as uploading business proof documents or screenshots of business operations, to help reviewers understand your business details.'), ownerId?: long(name='OwnerId'), qualificationId?: long(name='QualificationId', description='Approved or under-review qualification ID. > - Before applying for an SMS signature, please first [apply for qualifications](https://help.aliyun.com/zh/sms/user-guide/new-qualification?spm=a2c4g.11186623.0.0.718d187bbkpMRK). > - You can view the qualification ID on the [Qualification Management](https://dysms.console.aliyun.com/domestic/text/qualification) page. This parameter is required.', example='8563**'), remark?: string(name='Remark', description='Explanation of the SMS signature scenario, with a maximum length of 200 characters. > The scenario explanation is one of the reference information for signature review. Please provide a detailed description of the usage scenarios of the launched business, along with verifiable information such as website links, registered domain addresses, app store download links, full names of public accounts or mini-programs, etc. For login scenarios, test account credentials are also required. A well-informed application explanation will enhance the efficiency of signature and template reviews. Refer to the **Application Scenarios** column in the [Signature Source](https://help.aliyun.com/zh/sms/user-guide/signature-specifications-1?spm=a2c4g.11186623.0.i2#section-xup-k46-yi4) table for filling in SMS scenarios.', example='登录场景申请验证码'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), signName?: string(name='SignName', description='Signature not yet approved. This parameter is required.', example='阿里云验证码'), signSource?: int32(name='SignSource', description='Source of the signature. Values: - **0**: Full name or abbreviation of enterprises and institutions. - **1**: Full name or abbreviation of MIIT-registered websites. - **2**: Full name or abbreviation of app applications. - **3**: Full name or abbreviation of public accounts or mini-programs. - **4**: Full name or abbreviation of e-commerce platform store names. - **5**: Full name or abbreviation of trademarks. This parameter is required.', example='1'), signType?: int32(name='SignType', description='Signature type. It is recommended to use the default value. - **0**: Verification code - **1**: General (default)', example='1'), thirdParty?: boolean(name='ThirdParty', description='Whether the signature is for self-use or others. - false: Self-use - true: Others >Notice: When the signature is for self-use, select the self-use qualification ID; when it\\\\"s for others, choose the others\\\\" qualification ID.', example='false'), } model UpdateSmsSignResponseBody = { code?: string(name='Code', description='Request status code. * OK indicates a successful request. * For other error codes, refer to [Error Code List](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='OK'), orderId?: string(name='OrderId', description='Work order number. This parameter is used by auditors when querying audits. You need to provide this work order number for expedited review.', example='2004417****'), requestId?: string(name='RequestId', description='The ID of this call request, uniquely generated by Alibaba Cloud, which can be used for troubleshooting and issue localization.', example='A90E4451-FED7-49D2-87C8-00700A8C4D0D'), signName?: string(name='SignName', description='The modified signature name.', example='登录验证'), } model UpdateSmsSignResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateSmsSignResponseBody(name='body'), } /** * @summary Update Text SMS Signature * * @description - For details about the changes of this new interface and the original one, please refer to [Announcement on the Update of SMS Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Only signatures that have not passed the review can be modified. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm) and call this interface to modify and resubmit for review after modification. * - Signature information applied through the interface will be synchronized in the SMS service console. For operations related to signatures in the console, please see [SMS Signatures](https://help.aliyun.com/zh/sms/user-guide/create-signatures?spm). * * @param tmpReq UpdateSmsSignRequest * @param runtime runtime options for this request RuntimeOptions * @return UpdateSmsSignResponse */ async function updateSmsSignWithOptions(tmpReq: UpdateSmsSignRequest, runtime: Util.RuntimeOptions): UpdateSmsSignResponse { Util.validateModel(tmpReq); var request = new UpdateSmsSignShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.moreData)) { request.moreDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.moreData, 'MoreData', 'json'); } var query = {}; if (!Util.isUnset(request.applySceneContent)) { query['ApplySceneContent'] = request.applySceneContent; } if (!Util.isUnset(request.authorizationLetterId)) { query['AuthorizationLetterId'] = request.authorizationLetterId; } if (!Util.isUnset(request.moreDataShrink)) { query['MoreData'] = request.moreDataShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.qualificationId)) { query['QualificationId'] = request.qualificationId; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.signName)) { query['SignName'] = request.signName; } if (!Util.isUnset(request.signSource)) { query['SignSource'] = request.signSource; } if (!Util.isUnset(request.signType)) { query['SignType'] = request.signType; } if (!Util.isUnset(request.thirdParty)) { query['ThirdParty'] = request.thirdParty; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UpdateSmsSign', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Update Text SMS Signature * * @description - For details about the changes of this new interface and the original one, please refer to [Announcement on the Update of SMS Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Only signatures that have not passed the review can be modified. Please refer to [Handling Suggestions for Failed SMS Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm) and call this interface to modify and resubmit for review after modification. * - Signature information applied through the interface will be synchronized in the SMS service console. For operations related to signatures in the console, please see [SMS Signatures](https://help.aliyun.com/zh/sms/user-guide/create-signatures?spm). * * @param request UpdateSmsSignRequest * @return UpdateSmsSignResponse */ async function updateSmsSign(request: UpdateSmsSignRequest): UpdateSmsSignResponse { var runtime = new Util.RuntimeOptions{}; return updateSmsSignWithOptions(request, runtime); } model UpdateSmsTemplateRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, please enter the MIIT-registered domain with HTTP or HTTPS. - For launched apps, provide the app store display link with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, enter the full name of the public account or mini-program, ensuring they are online. - For e-commerce platform stores, applicable only to enterprise users, enter the display link of the e-commerce store with HTTP or HTTPS.', example='http://www.aliyun.com/'), intlType?: int32(name='IntlType', description='International/Hong Kong, Macao, and Taiwan template type. When the **TemplateType** parameter is **3**, this parameter is required for international/Hong Kong, Macao, and Taiwan templates, with values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS.', example='0'), moreData?: [ string ](name='MoreData', description='Additional information, such as uploading business proof documents or screenshots, to help reviewers understand your business details. Optional and can be left unset.'), ownerId?: long(name='OwnerId'), relatedSignName?: string(name='RelatedSignName', description='SMS signature associated with the template during the application.', example='阿里云'), remark?: string(name='Remark', description='Explanation for the SMS template application, which serves as a reference for template review.', example='登录场景使用验证码'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='Template Code of an unapproved template. This parameter is required.', example='SMS_152550****'), templateContent?: string(name='TemplateContent', description='Template content, up to 500 characters in length. Both the template content and variable content must comply with SMS regulations; otherwise, the template will fail the review. You can also view common template examples on the template application page. Using sample templates can enhance review efficiency and success rates. Variable specifications can be found in [TemplateContent Parameter Variable Specifications](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example?spm). This parameter is required.', example='您正在申请手机注册,验证码为:${code},5分钟内有效!'), templateName?: string(name='TemplateName', description='Template name, up to 30 characters in length. This parameter is required.', example='验证码'), templateRule?: string(name='TemplateRule', description='Template variable rules. For guidance on filling variable rules, refer to the [Sample Documentation](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example?spm).', example='{"code":"characterWithNumber"}'), templateType?: int32(name='TemplateType', description='SMS type. Values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS. - **3**: International/Hong Kong, Macao, and Taiwan messages. > Only enterprise-certified users can apply for promotional SMS and international/Hong Kong, Macao, and Taiwan messages. Details on differences between personal and enterprise user rights are available in [Usage Guidelines](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm=a2c4g.11186623.0.0.67447f576NJnE8). This parameter is required.', example='0'), } model UpdateSmsTemplateShrinkRequest { applySceneContent?: string(name='ApplySceneContent', description='Application scenarios, instructions as follows: - For registered websites, please enter the MIIT-registered domain with HTTP or HTTPS. - For launched apps, provide the app store display link with HTTP or HTTPS, ensuring the app is online. - For public accounts or mini-programs, enter the full name of the public account or mini-program, ensuring they are online. - For e-commerce platform stores, applicable only to enterprise users, enter the display link of the e-commerce store with HTTP or HTTPS.', example='http://www.aliyun.com/'), intlType?: int32(name='IntlType', description='International/Hong Kong, Macao, and Taiwan template type. When the **TemplateType** parameter is **3**, this parameter is required for international/Hong Kong, Macao, and Taiwan templates, with values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS.', example='0'), moreDataShrink?: string(name='MoreData', description='Additional information, such as uploading business proof documents or screenshots, to help reviewers understand your business details. Optional and can be left unset.'), ownerId?: long(name='OwnerId'), relatedSignName?: string(name='RelatedSignName', description='SMS signature associated with the template during the application.', example='阿里云'), remark?: string(name='Remark', description='Explanation for the SMS template application, which serves as a reference for template review.', example='登录场景使用验证码'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), templateCode?: string(name='TemplateCode', description='Template Code of an unapproved template. This parameter is required.', example='SMS_152550****'), templateContent?: string(name='TemplateContent', description='Template content, up to 500 characters in length. Both the template content and variable content must comply with SMS regulations; otherwise, the template will fail the review. You can also view common template examples on the template application page. Using sample templates can enhance review efficiency and success rates. Variable specifications can be found in [TemplateContent Parameter Variable Specifications](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example?spm). This parameter is required.', example='您正在申请手机注册,验证码为:${code},5分钟内有效!'), templateName?: string(name='TemplateName', description='Template name, up to 30 characters in length. This parameter is required.', example='验证码'), templateRule?: string(name='TemplateRule', description='Template variable rules. For guidance on filling variable rules, refer to the [Sample Documentation](https://help.aliyun.com/zh/sms/templaterule-template-variable-parameter-filling-example?spm).', example='{"code":"characterWithNumber"}'), templateType?: int32(name='TemplateType', description='SMS type. Values: - **0**: Verification code. - **1**: SMS notification. - **2**: Promotional SMS. - **3**: International/Hong Kong, Macao, and Taiwan messages. > Only enterprise-certified users can apply for promotional SMS and international/Hong Kong, Macao, and Taiwan messages. Details on differences between personal and enterprise user rights are available in [Usage Guidelines](https://help.aliyun.com/zh/sms/user-guide/usage-notes?spm=a2c4g.11186623.0.0.67447f576NJnE8). This parameter is required.', example='0'), } model UpdateSmsTemplateResponseBody = { code?: string(name='Code', description='Request status code. * OK indicates a successful request. * For other error codes, refer to the **Error Codes** section of this chapter or the product\\\\"s [API Error Codes](https://help.aliyun.com/document_detail/101346.html).', example='OK'), message?: string(name='Message', description='Description of the status code.', example='OK'), orderId?: string(name='OrderId', description='Work order number. This parameter is used by auditors when querying audits. You need to provide this work order number when requesting expedited review.', example='20041271****'), requestId?: string(name='RequestId', description='The ID of this call request, which is a unique identifier generated by Alibaba Cloud for the request and can be used to troubleshoot and locate issues.', example='819BE656-D2E0-4858-8B21-B2E477085AAF'), templateCode?: string(name='TemplateCode', description='Code of the SMS template.', example='SMS_152550****'), templateName?: string(name='TemplateName', description='Name of the SMS template.', example='验证码'), } model UpdateSmsTemplateResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: UpdateSmsTemplateResponseBody(name='body'), } /** * @summary Update Text SMS Template * * @description - For details about the changes of this new interface compared to the original one, please refer to [Announcement on SMS Service Update: Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Only templates that have not passed the review can be modified. Please refer to [Handling Suggestions for Failed SMS Template Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm=a2c4g.11186623.0.0.4bf5561ajcFtMQ) and call this interface to modify and resubmit for review. * - Modifications made through the interface will be synchronized in the SMS service console. For related operations on templates in the console, see [SMS Templates](https://help.aliyun.com/zh/sms/user-guide/message-templates/?spm=a2c4g.11186623.0.0.35a947464Itaxp). * ### QPS Limit * The single-user QPS limit for this interface is 1000 times/second. Exceeding this limit will result in API throttling, which may impact your business. Please make calls reasonably. * * @param tmpReq UpdateSmsTemplateRequest * @param runtime runtime options for this request RuntimeOptions * @return UpdateSmsTemplateResponse */ async function updateSmsTemplateWithOptions(tmpReq: UpdateSmsTemplateRequest, runtime: Util.RuntimeOptions): UpdateSmsTemplateResponse { Util.validateModel(tmpReq); var request = new UpdateSmsTemplateShrinkRequest{}; OpenApiUtil.convert(tmpReq, request); if (!Util.isUnset(tmpReq.moreData)) { request.moreDataShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.moreData, 'MoreData', 'json'); } var query = {}; if (!Util.isUnset(request.applySceneContent)) { query['ApplySceneContent'] = request.applySceneContent; } if (!Util.isUnset(request.intlType)) { query['IntlType'] = request.intlType; } if (!Util.isUnset(request.moreDataShrink)) { query['MoreData'] = request.moreDataShrink; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.relatedSignName)) { query['RelatedSignName'] = request.relatedSignName; } if (!Util.isUnset(request.remark)) { query['Remark'] = request.remark; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } if (!Util.isUnset(request.templateCode)) { query['TemplateCode'] = request.templateCode; } if (!Util.isUnset(request.templateContent)) { query['TemplateContent'] = request.templateContent; } if (!Util.isUnset(request.templateName)) { query['TemplateName'] = request.templateName; } if (!Util.isUnset(request.templateRule)) { query['TemplateRule'] = request.templateRule; } if (!Util.isUnset(request.templateType)) { query['TemplateType'] = request.templateType; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'UpdateSmsTemplate', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary Update Text SMS Template * * @description - For details about the changes of this new interface compared to the original one, please refer to [Announcement on SMS Service Update: Signature & Template Interfaces](https://help.aliyun.com/zh/sms/product-overview/announcement-on-sms-service-update-signature-template-interface). * - Only templates that have not passed the review can be modified. Please refer to [Handling Suggestions for Failed SMS Template Reviews](https://help.aliyun.com/zh/sms/user-guide/causes-of-application-failures-and-suggestions?spm=a2c4g.11186623.0.0.4bf5561ajcFtMQ) and call this interface to modify and resubmit for review. * - Modifications made through the interface will be synchronized in the SMS service console. For related operations on templates in the console, see [SMS Templates](https://help.aliyun.com/zh/sms/user-guide/message-templates/?spm=a2c4g.11186623.0.0.35a947464Itaxp). * ### QPS Limit * The single-user QPS limit for this interface is 1000 times/second. Exceeding this limit will result in API throttling, which may impact your business. Please make calls reasonably. * * @param request UpdateSmsTemplateRequest * @return UpdateSmsTemplateResponse */ async function updateSmsTemplate(request: UpdateSmsTemplateRequest): UpdateSmsTemplateResponse { var runtime = new Util.RuntimeOptions{}; return updateSmsTemplateWithOptions(request, runtime); } model ValidPhoneCodeRequest { certifyCode?: string(name='CertifyCode', description='验证码 This parameter is required.', example='1234'), ownerId?: long(name='OwnerId'), phoneNo?: string(name='PhoneNo', description='手机号 This parameter is required.', example='137****1234'), resourceOwnerAccount?: string(name='ResourceOwnerAccount'), resourceOwnerId?: long(name='ResourceOwnerId'), } model ValidPhoneCodeResponseBody = { accessDeniedDetail?: string(name='AccessDeniedDetail'), code?: string(name='Code', example='OK'), data?: boolean(name='Data', example='true'), message?: string(name='Message', example='OK'), requestId?: string(name='RequestId', example='90E63D28-E31D-1EB2-8939-A9486641****'), success?: boolean(name='Success', example='true'), } model ValidPhoneCodeResponse = { headers?: map[string]string(name='headers'), statusCode?: int32(name='statusCode'), body?: ValidPhoneCodeResponseBody(name='body'), } /** * @summary 发送手机验证码 * * @param request ValidPhoneCodeRequest * @param runtime runtime options for this request RuntimeOptions * @return ValidPhoneCodeResponse */ async function validPhoneCodeWithOptions(request: ValidPhoneCodeRequest, runtime: Util.RuntimeOptions): ValidPhoneCodeResponse { Util.validateModel(request); var query = {}; if (!Util.isUnset(request.certifyCode)) { query['CertifyCode'] = request.certifyCode; } if (!Util.isUnset(request.ownerId)) { query['OwnerId'] = request.ownerId; } if (!Util.isUnset(request.phoneNo)) { query['PhoneNo'] = request.phoneNo; } if (!Util.isUnset(request.resourceOwnerAccount)) { query['ResourceOwnerAccount'] = request.resourceOwnerAccount; } if (!Util.isUnset(request.resourceOwnerId)) { query['ResourceOwnerId'] = request.resourceOwnerId; } var req = new OpenApi.OpenApiRequest{ query = OpenApiUtil.query(query), }; var params = new OpenApi.Params{ action = 'ValidPhoneCode', version = '2017-05-25', protocol = 'HTTPS', pathname = '/', method = 'POST', authType = 'AK', style = 'RPC', reqBodyType = 'formData', bodyType = 'json', }; return callApi(params, req, runtime); } /** * @summary 发送手机验证码 * * @param request ValidPhoneCodeRequest * @return ValidPhoneCodeResponse */ async function validPhoneCode(request: ValidPhoneCodeRequest): ValidPhoneCodeResponse { var runtime = new Util.RuntimeOptions{}; return validPhoneCodeWithOptions(request, runtime); }