阿里云短信介绍和购买流程和使用流程

简介: 联网时代短信的应用无处不在,如APP的注册,平时的短信通知等。下面就由小编系统的讲解一下阿里云短信的购买和使用流程

互联网时代短信的应用无处不在,如APP的注册,平时的短信通知等。

下面就由小编系统的讲解一下阿里云短信的购买和使用流程

1,无论怎么样首先你需要注册个阿里云账号

  1. 点击下面链接注册:

注册阿里云

输入账户名和密码和手机号


注册完成以后,请到个人中心做实名。 切记:如果是企业行为一定是要做企业实名,不要个人实名。https://account.console.aliyun.com/v2/#/authc/types


2,购买短信套餐包

  1. 点击下面链接:https://www.aliyun.com/product/sms


点击:立即购买 一般项目刚刚上线,选择1.5万条短信就够了。


3,设置短信签名

  1. https://dysms.console.aliyun.com/domestic/text


填写:签名,签名用途,签名来源,场景说明




4,设置短信模板。


填写:模型类型,关联签名,模板名称,模板内容,场景链接,场景说明


5,接入短信SDK

首先获取到AccessKey

AccessKey ID:用于标识用户。

AccessKey Secret:用于验证用户的密钥。AccessKey Secret必须保密。

点击下面链接:

https://ram.console.aliyun.com/manage/ak?spm=5176.12818093.top-nav.dak.5adc16d0Ixl28b

创建AccessKey



以下是发送短信和批量发送短信的接口地址:

https://help.aliyun.com/document_detail/419273.html?spm=a2c4g.419274.0.0.29cb4198AtA3Qx


调试发送短信的demo

https://next.api.aliyun.com/api/Dysmsapi/2017-05-25/SendSms?spm=a2c4g.419273.0.i1&tab=DEMO&lang=JAVAASYNC


下面是Java代码实力

// This file is auto-generated, don't edit it. Thanks. package demo; import com.aliyun.auth.credentials.Credential; import com.aliyun.auth.credentials.provider.StaticCredentialProvider; import com.aliyun.core.http.HttpClient; import com.aliyun.core.http.HttpMethod; import com.aliyun.core.http.ProxyOptions; import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder; import com.aliyun.sdk.service.dysmsapi20170525.models.*; import com.aliyun.sdk.service.dysmsapi20170525.*; import com.google.gson.Gson; import darabonba.core.RequestConfiguration; import darabonba.core.client.ClientOverrideConfiguration; import darabonba.core.utils.CommonUtil; import darabonba.core.TeaPair; //import javax.net.ssl.KeyManager; //import javax.net.ssl.X509TrustManager; import java.net.InetSocketAddress; import java.time.Duration; import java.util.*; import java.util.concurrent.CompletableFuture; public class SendSms {     public static void main(String[] args) throws Exception {         // HttpClient Configuration         /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()                 .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout time, the default is 10 seconds                 .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout time, the default is 20 seconds                 .maxConnections(128) // Set the connection pool size                 .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout, the default is 30 seconds                 // Configure the proxy                 .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<your-proxy-hostname>", 9001))                         .setCredentials("<your-proxy-username>", "<your-proxy-password>"))                 // If it is an https connection, you need to configure the certificate, or ignore the certificate(.ignoreSSL(true))                 .x509TrustManagers(new X509TrustManager[]{})                 .keyManagers(new KeyManager[]{})                 .ignoreSSL(false)                 .build();*/         // Configure Credentials authentication information, including ak, secret, token         StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()                 .accessKeyId("<your-accessKeyId>")                 .accessKeySecret("<your-accessKeySecret>")                 //.securityToken("<your-token>") // use STS token                 .build());         // Configure the Client         AsyncClient client = AsyncClient.builder()                 .region("cn-hangzhou") // Region ID                 //.httpClient(httpClient) // Use the configured HttpClient, otherwise use the default HttpClient (Apache HttpClient)                 .credentialsProvider(provider)                 //.serviceConfiguration(Configuration.create()) // Service-level configuration                 // Client-level configuration rewrite, can set Endpoint, Http request parameters, etc.                 .overrideConfiguration(                         ClientOverrideConfiguration.create()                                 .setEndpointOverride("dysmsapi.aliyuncs.com")                         //.setConnectTimeout(Duration.ofSeconds(30))                 )                 .build();         // Parameter settings for API request         SendSmsRequest sendSmsRequest = SendSmsRequest.builder()                 // Request-level configuration rewrite, can set Http request parameters, etc.                 // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))                 .build();         // Asynchronously get the return value of the API request         CompletableFuture<SendSmsResponse> response = client.sendSms(sendSmsRequest);         // Synchronously get the return value of the API request         SendSmsResponse resp = response.get();         System.out.println(new Gson().toJson(resp));         // Asynchronous processing of return values         /*response.thenAccept(resp -> {             System.out.println(new Gson().toJson(resp));         }).exceptionally(throwable -> { // Handling exceptions             System.out.println(throwable.getMessage());             return null;         });*/         // Finally, close the client         client.close();     } }

下面是PHP代码示例

<?php // This file is auto-generated, don't edit it. Thanks. namespace AlibabaCloud\SDK\Sample; use AlibabaCloud\SDK\Dysmsapi\V20170525\Dysmsapi; use \Exception; use AlibabaCloud\Tea\Exception\TeaError; use AlibabaCloud\Tea\Utils\Utils; use Darabonba\OpenApi\Models\Config; use AlibabaCloud\SDK\Dysmsapi\V20170525\Models\SendSmsRequest; use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions; class Sample {     /**      * 使用AK&SK初始化账号Client      * @param string $accessKeyId      * @param string $accessKeySecret      * @return Dysmsapi Client      */     public static function createClient($accessKeyId, $accessKeySecret){         $config = new Config([             // 必填,您的 AccessKey ID             "accessKeyId" => $accessKeyId,             // 必填,您的 AccessKey Secret             "accessKeySecret" => $accessKeySecret         ]);         // 访问的域名         $config->endpoint = "dysmsapi.aliyuncs.com";         return new Dysmsapi($config);     }     /**      * @param string[] $args      * @return void      */     public static function main($args){         // 工程代码泄露可能会导致AccessKey泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考,建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/311677.html        $client = self::createClient("accessKeyId", "accessKeySecret");         $sendSmsRequest = new SendSmsRequest([]);         $runtime = new RuntimeOptions([]);         try {             // 复制代码运行请自行打印 API 的返回值             $client->sendSmsWithOptions($sendSmsRequest, $runtime);         }         catch (Exception $error) {             if (!($error instanceof TeaError)) {                 $error = new TeaError([], $error->getMessage(), $error->getCode(), $error);             }             // 如有需要,请打印 error             Utils::assertAsString($error->message);         }     } } $path = __DIR__ . \DIRECTORY_SEPARATOR . '..' . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR . 'autoload.php'; if (file_exists($path)) {     require_once $path; } Sample::main(array_slice($argv, 1));


相关文章
|
1天前
阿里云域名注册流程图和费用说明,新手第一次购买域名攻略
阿里云域名注册指南:访问[阿里云域名注册入口查询域名,选择后缀,加入清单并结算。价格如.com: 78元/首年。创建信息模板进行实名认证。获取优惠口令并使用,参照流程完成购买。详细步骤及域名价格详情见原文。
8 0
|
2天前
|
域名解析 弹性计算 Linux
阿里云购买云服务器、注册域名、备案及绑定图文教程参考
本文为大家介绍了2024年购买阿里云服务器和注册域名,绑定以及备案的教程,适合需要在阿里云购买云服务器、注册域名并备案的用户参考,新手用户可通过此文您了解在从购买云服务器到完成备案的流程。
阿里云购买云服务器、注册域名、备案及绑定图文教程参考
|
2天前
使用阿里云语音通知http批量推送模式获取用户回执短信内容
本文使用阿里云语音通知配置http批量推送模式获取用户回执信息,并进行测试
20 0
|
6天前
|
弹性计算
阿里云备案流程和操作步骤详解(图文教程)
以下是内容摘要: 本文指导了阿里云账号注册、实名认证及服务器购买流程,并详细阐述了域名注册与备案步骤。首先,需注册阿里云账号并完成个人或企业实名认证,然后选购服务器。接着,进行域名注册与实名认证。备案阶段,用户需在阿里云备案系统中填写相关信息,包括主体信息、网站信息,并上传相关证件照片。提交备案后,系统将进行审核,用户可通过阿里云ICP代备案平台查看进度。整个过程需确保联系方式畅通,以便接收审核通知。
|
6天前
|
域名解析 网络协议 大数据
阿里云域名购买与域名解析使用教程(图文教程)
该文档是关于在阿里云注册账号、购买域名及进行DNS解析的步骤指南。首先,需注册阿里云账号并进行实名认证,建议选择企业认证以便获取企业发票。接着,通过阿里云域名注册页面检查并购买未被注册的域名,将域名添加至购物车并完成支付。购买后,在云解析DNS界面进行实名认证,然后对域名进行解析设置,选择A记录类型,填写主机记录(如www),记录值为云服务器的IP地址,设置TTL,并校验解析是否成功。最后,文中还提及了如何在云服务器上进行实例名称的修改和查看服务器状态等操作。
|
7天前
|
存储 小程序 数据库
阿里云学生服务器申请流程_学生党免费领7个月学生机
阿里云2024年推出学生优惠,大陆在籍学生可免费申领7个月学生服务器,配置为2核2G,无限流量,含独立IP。学生需注册账号、完成实名及学生认证,首月免费,完成任务可续费6个月。此外,还有300元无门槛优惠券可在阿里云高校计划中领取,适用于多种云产品。申请及优惠详情见官方链接。
69 2
阿里云学生服务器申请流程_学生党免费领7个月学生机
|
13天前
|
弹性计算 Java Linux
阿里云服务器搭建部署宝塔详细流程
该内容是一个阿里云服务器和域名的配置指南。首先,需注册阿里云账号并进行企业实名认证。接着,选购服务器如2核2G1兆的Linux系统,并购买域名。完成域名备案后,进行域名解析和ICP备案。然后,通过远程连接登录服务器,重置密码,安装宝塔面板。在安全组中开启宝塔面板随机生成的端口。最后,登录宝塔面板安装LNMP环境,配置数据库如MySQL和Redis,部署JDK、Tomcat,上传前端和后端项目以实现上线。
|
29天前
|
弹性计算 安全 Linux
阿里云服务器购买图文教程参考,四种购买阿里云服务器的方式及适用场景分享
阿里云服务器如何购买?目前主要的购买方式有自定义购买、快速购买、通过活动购买、通过云市场镜像页面购买这四种购买方式,每种方式都有主要的适合对象,购买流程也不是完全一样的。例如想要快速购买的用户,一般选择快速购买、通过活动购买最好,如果是想购买的云服务器已经部署好一些自己项目运行所需的各种环境和软件,则选择通过云市场镜像页面购买这种方式更好。本文为以图文形式为大家展示四种购买阿里云服务器的方式及适用场景,以供参考。
阿里云服务器购买图文教程参考,四种购买阿里云服务器的方式及适用场景分享
|
4天前
|
网络协议 Serverless 应用服务中间件
Serverless 应用引擎操作报错合集之在阿里云函数计算中,服务器调用FC函数时出现 "[Errno -3] Temporary failure in name resolution)" 错误如何解决
Serverless 应用引擎(SAE)是阿里云提供的Serverless PaaS平台,支持Spring Cloud、Dubbo、HSF等主流微服务框架,简化应用的部署、运维和弹性伸缩。在使用SAE过程中,可能会遇到各种操作报错。以下是一些常见的报错情况及其可能的原因和解决方法。
23 4
|
6天前
|
存储 小程序 数据库
阿里云学生云服务器申请,阿里云送每个大学生一台云服务器
2024年,阿里云为学生提供免费7个月的学生服务器,包括2核2G配置、1M带宽和独立IP。学生需通过学信网认证,完成任务可额外获得6个月免费时长。申请流程包括注册阿里云账号、实名认证和学生认证。此外,学生可免费领取300元无门槛优惠券,在阿里云高校计划中使用。学生服务器可用于建站、部署等多种场景。详细信息和申请入口见官方链接。
68 0

热门文章

最新文章