Dokumentasi ini AWS CLI hanya untuk Versi 1. Untuk dokumentasi yang terkait dengan Versi 2 AWS CLI, lihat Panduan Pengguna Versi 2.
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Amazon Pinpoint contoh menggunakan AWS CLI
Contoh kode berikut menunjukkan cara melakukan tindakan dan mengimplementasikan skenario umum dengan menggunakan AWS Command Line Interface dengan Amazon Pinpoint.
Tindakan adalah kutipan kode dari program yang lebih besar dan harus dijalankan dalam konteks. Sementara tindakan menunjukkan cara memanggil fungsi layanan individual, Anda dapat melihat tindakan dalam konteks dalam skenario terkait.
Setiap contoh menyertakan tautan ke kode sumber lengkap, di mana Anda dapat menemukan instruksi tentang cara mengatur dan menjalankan kode dalam konteks.
Topik
Tindakan
Contoh kode berikut menunjukkan cara menggunakancreate-app
.
- AWS CLI
-
Contoh 1: Untuk membuat aplikasi
create-app
Contoh berikut membuat aplikasi baru (proyek).aws pinpoint create-app \ --create-application-request
Name=ExampleCorp
Output:
{ "ApplicationResponse": { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example", "Id": "810c7aab86d42fb2b56c8c966example", "Name": "ExampleCorp", "tags": {} } }
Contoh 2: Untuk membuat aplikasi yang diberi tag
create-app
Contoh berikut membuat aplikasi baru (proyek) dan mengaitkan tag (kunci dan nilai) dengan aplikasi.aws pinpoint create-app \ --create-application-request Name=ExampleCorp,tags={"Stack"="Test"}
Output:
{ "ApplicationResponse": { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example", "Id": "810c7aab86d42fb2b56c8c966example", "Name": "ExampleCorp", "tags": { "Stack": "Test" } } }
-
Untuk detail API, lihat CreateApp
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakancreate-sms-template
.
- AWS CLI
-
Membuat template pesan untuk pesan yang dikirim melalui saluran SMS
create-sms-template
Contoh berikut membuat template pesan SMS.aws pinpoint create-sms-template \ --template-name
TestTemplate
\ --sms-template-requestfile://myfile.json
\ --regionus-east-1
Isi dari
myfile.json
:{ "Body": "hello\n how are you?\n food is good", "TemplateDescription": "Test SMS Template" }
Output:
{ "CreateTemplateMessageBody": { "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:templates/TestTemplate/SMS", "Message": "Created", "RequestID": "8c36b17f-a0b0-400f-ac21-29e9b62a975d" } }
Untuk informasi selengkapnya, lihat templat pesan Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat CreateSmsTemplate
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakandelete-app
.
- AWS CLI
-
Untuk menghapus aplikasi
delete-app
Contoh berikut menghapus aplikasi (proyek).aws pinpoint delete-app \ --application-id
810c7aab86d42fb2b56c8c966example
Output:
{ "ApplicationResponse": { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example", "Id": "810c7aab86d42fb2b56c8c966example", "Name": "ExampleCorp", "tags": {} } }
-
Untuk detail API, lihat DeleteApp
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-apns-channel
.
- AWS CLI
-
Untuk mengambil informasi tentang status dan pengaturan APNs saluran untuk aplikasi
get-apns-channel
Contoh berikut mengambil informasi tentang status dan pengaturan APNs saluran untuk aplikasi.aws pinpoint get-apns-channel \ --application-id
9ab1068eb0a6461c86cce7f27ce0efd7
\ --regionus-east-1
Output:
{ "APNSChannelResponse": { "ApplicationId": "9ab1068eb0a6461c86cce7f27ce0efd7", "CreationDate": "2019-05-09T21:54:45.082Z", "DefaultAuthenticationMethod": "CERTIFICATE", "Enabled": true, "HasCredential": true, "HasTokenKey": false, "Id": "apns", "IsArchived": false, "LastModifiedDate": "2019-05-09T22:04:01.067Z", "Platform": "APNS", "Version": 2 } }
-
Untuk detail API, lihat GetApnsChannel
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-app
.
- AWS CLI
-
Untuk mengambil informasi tentang aplikasi (proyek)
get-app
Contoh berikut mengambil informasi tentang aplikasi (proyek).aws pinpoint get-app \ --application-id
810c7aab86d42fb2b56c8c966example
\ --regionus-east-1
Output:
{ "ApplicationResponse": { "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example", "Id": "810c7aab86d42fb2b56c8c966example", "Name": "ExampleCorp", "tags": { "Year": "2019", "Stack": "Production" } } }
-
Untuk detail API, lihat GetApp
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-apps
.
- AWS CLI
-
Untuk mengambil informasi tentang semua aplikasi Anda
get-apps
Contoh berikut mengambil informasi tentang semua aplikasi Anda (proyek).aws pinpoint get-apps
Output:
{ "ApplicationsResponse": { "Item": [ { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example", "Id": "810c7aab86d42fb2b56c8c966example", "Name": "ExampleCorp", "tags": { "Year": "2019", "Stack": "Production" } }, { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/42d8c7eb0990a57ba1d5476a3example", "Id": "42d8c7eb0990a57ba1d5476a3example", "Name": "AnyCompany", "tags": {} }, { "Arn": "arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/80f5c382b638ffe5ad12376bbexample", "Id": "80f5c382b638ffe5ad12376bbexample", "Name": "ExampleCorp_Test", "tags": { "Year": "2019", "Stack": "Test" } } ], "NextToken": "eyJDcmVhdGlvbkRhdGUiOiIyMDE5LTA3LTE2VDE0OjM4OjUzLjkwM1oiLCJBY2NvdW50SWQiOiI1MTIzOTcxODM4NzciLCJBcHBJZCI6Ijk1ZTM2MGRiMzBkMjQ1ZjRiYTYwYjhlMzllMzZlNjZhIn0" } }
Kehadiran nilai
NextToken
respons menunjukkan bahwa ada lebih banyak output yang tersedia. Panggil perintah lagi dan berikan nilai itu sebagai parameterNextToken
input.-
Untuk detail API, lihat GetApps
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-campaign
.
- AWS CLI
-
Untuk mengambil informasi tentang status, konfigurasi, dan setelan lain untuk kampanye
get-campaign
Contoh berikut mengambil informasi tentang status, konfigurasi, dan setelan lain untuk kampanye.aws pinpoint get-campaign \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --campaign-ida1e63c6cc0eb43ed826ffcc3cc90b30d
\ --regionus-east-1
Output:
{ "CampaignResponse": { "AdditionalTreatments": [], "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/6e0b7591a90841d2b5d93fa11143e5a7/campaigns/a1e63c6cc0eb43ed826ffcc3cc90b30d", "CreationDate": "2019-10-08T18:40:16.581Z", "Description": " ", "HoldoutPercent": 0, "Id": "a1e63c6cc0eb43ed826ffcc3cc90b30d", "IsPaused": false, "LastModifiedDate": "2019-10-08T18:40:16.581Z", "Limits": { "Daily": 0, "MaximumDuration": 60, "MessagesPerSecond": 50, "Total": 0 }, "MessageConfiguration": { "EmailMessage": { "FromAddress": "sender@example.com", "HtmlBody": "<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n</head>\n<body>Hello</body>\n</html>", "Title": "PinpointDemo" } }, "Name": "MyCampaign", "Schedule": { "IsLocalTime": false, "StartTime": "IMMEDIATE", "Timezone": "utc" }, "SegmentId": "b66c9e42f71444b2aa2e0ffc1df28f60", "SegmentVersion": 1, "State": { "CampaignStatus": "COMPLETED" }, "tags": {}, "TemplateConfiguration": {}, "Version": 1 } }
-
Untuk detail API, lihat GetCampaign
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-campaigns
.
- AWS CLI
-
Untuk mengambil informasi tentang status, konfigurasi, dan setelan lainnya untuk semua kampanye yang terkait dengan aplikasi
get-campaigns
Contoh berikut mengambil informasi tentang status, konfigurasi, dan setelan lainnya untuk semua kampanye yang terkait dengan aplikasi.aws pinpoint get-campaigns \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "CampaignsResponse": { "Item": [ { "AdditionalTreatments": [], "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/6e0b7591a90841d2b5d93fa11143e5a7/campaigns/7e1280344c8f4a9aa40a00b006fe44f1", "CreationDate": "2019-10-08T18:40:22.905Z", "Description": " ", "HoldoutPercent": 0, "Id": "7e1280344c8f4a9aa40a00b006fe44f1", "IsPaused": false, "LastModifiedDate": "2019-10-08T18:40:22.905Z", "Limits": {}, "MessageConfiguration": { "EmailMessage": { "FromAddress": "sender@example.com", "HtmlBody": "<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n</head>\n<body>Hello</body>\n</html>", "Title": "PInpointDemo Test" } }, "Name": "MyCampaign1", "Schedule": { "IsLocalTime": false, "QuietTime": {}, "StartTime": "IMMEDIATE", "Timezone": "UTC" }, "SegmentId": "b66c9e42f71444b2aa2e0ffc1df28f60", "SegmentVersion": 1, "State": { "CampaignStatus": "COMPLETED" }, "tags": {}, "TemplateConfiguration": {}, "Version": 1 }, { "AdditionalTreatments": [], "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/6e0b7591a90841d2b5d93fa11143e5a7/campaigns/a1e63c6cc0eb43ed826ffcc3cc90b30d", "CreationDate": "2019-10-08T18:40:16.581Z", "Description": " ", "HoldoutPercent": 0, "Id": "a1e63c6cc0eb43ed826ffcc3cc90b30d", "IsPaused": false, "LastModifiedDate": "2019-10-08T18:40:16.581Z", "Limits": { "Daily": 0, "MaximumDuration": 60, "MessagesPerSecond": 50, "Total": 0 }, "MessageConfiguration": { "EmailMessage": { "FromAddress": "sender@example.com", "HtmlBody": "<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n</head>\n<body>Demo</body>\n</html>", "Title": "PinpointDemo" } }, "Name": "MyCampaign2", "Schedule": { "IsLocalTime": false, "StartTime": "IMMEDIATE", "Timezone": "utc" }, "SegmentId": "b66c9e42f71444b2aa2e0ffc1df28f60", "SegmentVersion": 1, "State": { "CampaignStatus": "COMPLETED" }, "tags": {}, "TemplateConfiguration": {}, "Version": 1 } ] } }
-
Untuk detail API, lihat GetCampaigns
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-channels
.
- AWS CLI
-
Untuk mengambil informasi tentang riwayat dan status setiap saluran untuk aplikasi
get-channels
Contoh berikut mengambil informasi tentang riwayat dan status setiap saluran untuk aplikasi.aws pinpoint get-channels \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "ChannelsResponse": { "Channels": { "GCM": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:28:23.182Z", "Enabled": true, "HasCredential": true, "Id": "gcm", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:28:23.182Z", "Version": 1 }, "SMS": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:39:18.511Z", "Enabled": true, "Id": "sms", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:39:18.511Z", "Version": 1 }, "EMAIL": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:27:23.990Z", "Enabled": true, "Id": "email", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:27:23.990Z", "Version": 1 }, "IN_APP": { "Enabled": true, "IsArchived": false, "Version": 0 } } } }
-
Untuk detail API, lihat GetChannels
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-email-channel
.
- AWS CLI
-
Untuk mengambil informasi tentang status dan pengaturan saluran Email untuk aplikasi
get-email-channel
Contoh berikut mengambil status dan pengaturan saluran Email untuk aplikasi.aws pinpoint get-email-channel \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "EmailChannelResponse": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:27:23.990Z", "Enabled": true, "FromAddress": "sender@example.com", "Id": "email", "Identity": "arn:aws:ses:us-east-1:AIDACKCEVSQ6C2EXAMPLE:identity/sender@example.com", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:27:23.990Z", "MessagesPerSecond": 1, "Platform": "EMAIL", "RoleArn": "arn:aws:iam::AIDACKCEVSQ6C2EXAMPLE:role/pinpoint-events", "Version": 1 } }
-
Untuk detail API, lihat GetEmailChannel
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-endpoint
.
- AWS CLI
-
Untuk mengambil informasi tentang pengaturan dan atribut titik akhir tertentu untuk aplikasi
get-endpoint
Contoh berikut mengambil informasi tentang pengaturan dan atribut titik akhir tertentu untuk aplikasi.aws pinpoint get-endpoint \ --application-id
611e3e3cdd47474c9c1399a505665b91
\ --endpoint-idtestendpoint
\ --regionus-east-1
Output:
{ "EndpointResponse": { "Address": "+11234567890", "ApplicationId": "611e3e3cdd47474c9c1399a505665b91", "Attributes": {}, "ChannelType": "SMS", "CohortId": "63", "CreationDate": "2019-01-28T23:55:11.534Z", "EffectiveDate": "2021-08-06T00:04:51.763Z", "EndpointStatus": "ACTIVE", "Id": "testendpoint", "Location": { "Country": "USA" }, "Metrics": { "SmsDelivered": 1.0 }, "OptOut": "ALL", "RequestId": "a204b1f2-7e26-48a7-9c80-b49a2143489d", "User": { "UserAttributes": { "Age": [ "24" ] }, "UserId": "testuser" } } }
-
Untuk detail API, lihat GetEndpoint
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-gcm-channel
.
- AWS CLI
-
Untuk mengambil informasi tentang status dan pengaturan saluran GCM untuk aplikasi
get-gcm-channel
Contoh berikut mengambil informasi tentang status dan pengaturan saluran GCM untuk aplikasi.aws pinpoint get-gcm-channel \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "GCMChannelResponse": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:28:23.182Z", "Enabled": true, "HasCredential": true, "Id": "gcm", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:28:23.182Z", "Platform": "GCM", "Version": 1 } }
-
Untuk detail API, lihat GetGcmChannel
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-sms-channel
.
- AWS CLI
-
Untuk mengambil informasi tentang status dan pengaturan saluran SMS untuk suatu aplikasi
get-sms-channel
Contoh berikut mengambil status dan pengaturan saluran sms untuk aplikasi.aws pinpoint get-sms-channel \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "SMSChannelResponse": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2019-10-08T18:39:18.511Z", "Enabled": true, "Id": "sms", "IsArchived": false, "LastModifiedDate": "2019-10-08T18:39:18.511Z", "Platform": "SMS", "PromotionalMessagesPerSecond": 20, "TransactionalMessagesPerSecond": 20, "Version": 1 } }
-
Untuk detail API, lihat GetSmsChannel
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-sms-template
.
- AWS CLI
-
Mengambil konten dan pengaturan template pesan untuk pesan yang dikirim melalui saluran SMS
get-sms-template
Contoh berikut mengambil konten dan pengaturan template pesan SMS.aws pinpoint get-sms-template \ --template-name
TestTemplate
\ --regionus-east-1
Output:
{ "SMSTemplateResponse": { "Arn": "arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:templates/TestTemplate/SMS", "Body": "hello\n how are you?\n food is good", "CreationDate": "2023-06-20T21:37:30.124Z", "LastModifiedDate": "2023-06-20T21:37:30.124Z", "tags": {}, "TemplateDescription": "Test SMS Template", "TemplateName": "TestTemplate", "TemplateType": "SMS", "Version": "1" } }
Untuk informasi selengkapnya, lihat templat pesan Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat GetSmsTemplate
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanget-voice-channel
.
- AWS CLI
-
Untuk mengambil informasi tentang status dan pengaturan saluran suara untuk suatu aplikasi
get-voice-channel
Contoh berikut mengambil status dan pengaturan saluran suara untuk aplikasi.aws pinpoint get-voice-channel \ --application-id
6e0b7591a90841d2b5d93fa11143e5a7
\ --regionus-east-1
Output:
{ "VoiceChannelResponse": { "ApplicationId": "6e0b7591a90841d2b5d93fa11143e5a7", "CreationDate": "2022-04-28T00:17:03.836Z", "Enabled": true, "Id": "voice", "IsArchived": false, "LastModifiedDate": "2022-04-28T00:17:03.836Z", "Platform": "VOICE", "Version": 1 } }
-
Untuk detail API, lihat GetVoiceChannel
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanlist-tags-for-resource
.
- AWS CLI
-
Untuk mengambil daftar tag untuk sumber daya
list-tags-for-resource
Contoh berikut mengambil semua tag (nama kunci dan nilai) yang terkait dengan sumber daya yang ditentukan.aws pinpoint list-tags-for-resource \ --resource-arn
arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example
Output:
{ "TagsModel": { "tags": { "Year": "2019", "Stack": "Production" } } }
Untuk informasi selengkapnya, lihat 'Menandai Sumber Daya Amazon Pinpoint https://docs.aws.amazon.com/pinpoint/ latest/developerguide/tagging < -resources.html>'__ di Panduan Pengembang Amazon Pinpoint.
-
Untuk detail API, lihat ListTagsForResource
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanphone-number-validate
.
- AWS CLI
-
Mengambil informasi tentang nomor telepon
Berikut ini
phone-number-validate
mengambil informasi tentang nomor telepon.aws pinpoint phone-number-validate \ --number-validate-request PhoneNumber="+12065550142" \ --region
us-east-1
Output:
{ "NumberValidateResponse": { "Carrier": "ExampleCorp Mobile", "City": "Seattle", "CleansedPhoneNumberE164": "+12065550142", "CleansedPhoneNumberNational": "2065550142", "Country": "United States", "CountryCodeIso2": "US", "CountryCodeNumeric": "1", "OriginalPhoneNumber": "+12065550142", "PhoneType": "MOBILE", "PhoneTypeCode": 0, "Timezone": "America/Los_Angeles", "ZipCode": "98101" } }
Untuk informasi selengkapnya, lihat saluran SMS Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat PhoneNumberValidate
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakansend-messages
.
- AWS CLI
-
Untuk mengirim pesan SMS menggunakan titik akhir aplikasi
send-messages
Contoh berikut mengirimkan pesan langsung untuk aplikasi dengan titik akhir.aws pinpoint send-messages \ --application-id
611e3e3cdd47474c9c1399a505665b91
\ --message-requestfile://myfile.json
\ --regionus-west-2
Isi dari
myfile.json
:{ "MessageConfiguration": { "SMSMessage": { "Body": "hello, how are you?" } }, "Endpoints": { "testendpoint": {} } }
Output:
{ "MessageResponse": { "ApplicationId": "611e3e3cdd47474c9c1399a505665b91", "EndpointResult": { "testendpoint": { "Address": "+12345678900", "DeliveryStatus": "SUCCESSFUL", "MessageId": "itnuqhai5alf1n6ahv3udc05n7hhddr6gb3lq6g0", "StatusCode": 200, "StatusMessage": "MessageId: itnuqhai5alf1n6ahv3udc05n7hhddr6gb3lq6g0" } }, "RequestId": "c7e23264-04b2-4a46-b800-d24923f74753" } }
Untuk informasi selengkapnya, lihat saluran SMS Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat SendMessages
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakansend-users-messages
.
- AWS CLI
-
Untuk mengirim pesan SMS untuk pengguna aplikasi
send-users-messages
Contoh berikut mengirimkan pesan langsung untuk pengguna aplikasi.aws pinpoint send-users-messages \ --application-id
611e3e3cdd47474c9c1399a505665b91
\ --send-users-message-requestfile://myfile.json
\ --regionus-west-2
Isi dari
myfile.json
:{ "MessageConfiguration": { "SMSMessage": { "Body": "hello, how are you?" } }, "Users": { "testuser": {} } }
Output:
{ "SendUsersMessageResponse": { "ApplicationId": "611e3e3cdd47474c9c1399a505665b91", "RequestId": "e0b12cf5-2359-11e9-bb0b-d5fb91876b25", "Result": { "testuser": { "testuserendpoint": { "DeliveryStatus": "SUCCESSFUL", "MessageId": "7qu4hk5bqhda3i7i2n4pjf98qcuh8b7p45ifsmo0", "StatusCode": 200, "StatusMessage": "MessageId: 7qu4hk5bqhda3i7i2n4pjf98qcuh8b7p45ifsmo0", "Address": "+12345678900" } } } } }
Untuk informasi selengkapnya, lihat saluran SMS Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat SendUsersMessages
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakantag-resource
.
- AWS CLI
-
Untuk menambahkan tag ke sumber daya
Contoh berikut menambahkan dua tag (nama kunci dan nilai) ke sumber daya.
aws pinpoint list-tags-for-resource \ --resource-arn
arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example
\ --tags-modeltags={Stack=Production,Year=2019}
Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat 'Menandai Sumber Daya Amazon Pinpoint https://docs.aws.amazon.com/pinpoint/ latest/developerguide/tagging < -resources.html>'__ di Panduan Pengembang Amazon Pinpoint.
-
Untuk detail API, lihat TagResource
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanuntag-resource
.
- AWS CLI
-
Contoh 1: Untuk menghapus tag dari sumber daya
untag-resource
Contoh berikut menghapus tag tertentu (nama kunci dan nilai) dari sumber daya.aws pinpoint untag-resource \ --resource-arn
arn:aws:mobiletargeting:us-west-2:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example
\ --tag-keysYear
Perintah ini tidak menghasilkan output.
Contoh 2: Untuk menghapus beberapa tag dari sumber daya
untag-resource
Contoh berikut menghapus tag yang ditentukan (nama kunci dan nilai) dari sumber daya.aws pinpoint untag-resource \ --resource-arn
arn:aws:mobiletargeting:us-east-1:AIDACKCEVSQ6C2EXAMPLE:apps/810c7aab86d42fb2b56c8c966example
\ --tag-keysYear
Stack
Perintah ini tidak menghasilkan output.
Untuk informasi selengkapnya, lihat 'Menandai Sumber Daya Amazon Pinpoint https://docs.aws.amazon.com/pinpoint/ latest/developerguide/tagging < -resources.html>'__ di Panduan Pengembang Amazon Pinpoint.
-
Untuk detail API, lihat UntagResource
di Referensi AWS CLI Perintah.
-
Contoh kode berikut menunjukkan cara menggunakanupdate-sms-channel
.
- AWS CLI
-
Untuk mengaktifkan saluran SMS atau memperbarui status dan pengaturan saluran SMS untuk suatu aplikasi.
update-sms-channel
Contoh berikut memungkinkan saluran SMS untuk saluran SMS untuk suatu aplikasi.aws pinpoint update-sms-channel \ --application-id
611e3e3cdd47474c9c1399a505665b91
\ --sms-channel-requestEnabled=true
\ --regionus-west-2
Output:
{ "SMSChannelResponse": { "ApplicationId": "611e3e3cdd47474c9c1399a505665b91", "CreationDate": "2019-01-28T23:25:25.224Z", "Enabled": true, "Id": "sms", "IsArchived": false, "LastModifiedDate": "2023-05-18T23:22:50.977Z", "Platform": "SMS", "PromotionalMessagesPerSecond": 20, "TransactionalMessagesPerSecond": 20, "Version": 3 } }
Untuk informasi selengkapnya, lihat saluran SMS Amazon Pinpoint di Panduan Pengguna Amazon Pinpoint.
-
Untuk detail API, lihat UpdateSmsChannel
di Referensi AWS CLI Perintah.
-