Amazon Pinpoint에서 엔드포인트 삭제 - Amazon Pinpoint

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Amazon Pinpoint에서 엔드포인트 삭제

특정 대상에 더 이상 메시지를 보내고 싶지 않은 경우(예: 목적지에 연결할 수 없거나, 고객이 계정을 폐쇄하는 경우), 엔드포인트를 삭제할 수 있습니다.

다음 예제에서는 엔드포인트를 삭제하는 방법을 보여줍니다.

AWS CLI

AWS CLI에서 명령을 실행하여 Amazon Pinpoint를 사용할 수 있습니다.

예 엔드포인트 삭제 명령

엔드포인트를 삭제하려면 delete-endpoint 명령을 사용합니다.

$ aws pinpoint delete-endpoint \ > --application-id application-id \ > --endpoint-id endpoint-id

위치:

  • application-id는 엔드포인트가 포함된 Amazon Pinpoint 프로젝트의 ID입니다.

  • endpoint-id는 삭제할 엔드포인트의 ID입니다.

이 요청에 대한 응답은 삭제한 엔드포인트의 JSON 정의입니다.

AWS SDK for Java

AWS SDK for Java에서 제공하는 클라이언트를 사용하여 Java 애플리케이션에서 Amazon Pinpoint API를 사용할 수 있습니다.

예 코드

엔드포인트를 삭제하려면 AmazonPinpoint 클라이언트의 deleteEndpoint 메서드를 사용합니다. DeleteEndpointRequest 객체를 메서드 인수로 제공합니다.

import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.pinpoint.PinpointClient; import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointRequest; import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointResponse; import software.amazon.awssdk.services.pinpoint.model.PinpointException;
import software.amazon.awssdk.regions.Region; import software.amazon.awssdk.services.pinpoint.PinpointClient; import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointRequest; import software.amazon.awssdk.services.pinpoint.model.DeleteEndpointResponse; import software.amazon.awssdk.services.pinpoint.model.PinpointException; /** * Before running this Java V2 code example, set up your development * environment, including your credentials. * * For more information, see the following documentation topic: * * https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html */ public class DeleteEndpoint { public static void main(String[] args) { final String usage = """ Usage: <appName> <endpointId > Where: appId - The id of the application to delete. endpointId - The id of the endpoint to delete. """; if (args.length != 2) { System.out.println(usage); System.exit(1); } String appId = args[0]; String endpointId = args[1]; System.out.println("Deleting an endpoint with id: " + endpointId); PinpointClient pinpoint = PinpointClient.builder() .region(Region.US_EAST_1) .build(); deletePinEncpoint(pinpoint, appId, endpointId); pinpoint.close(); } public static void deletePinEncpoint(PinpointClient pinpoint, String appId, String endpointId) { try { DeleteEndpointRequest appRequest = DeleteEndpointRequest.builder() .applicationId(appId) .endpointId(endpointId) .build(); DeleteEndpointResponse result = pinpoint.deleteEndpoint(appRequest); String id = result.endpointResponse().id(); System.out.println("The deleted endpoint id " + id); } catch (PinpointException e) { System.err.println(e.awsErrorDetails().errorMessage()); System.exit(1); } System.out.println("Done"); } }

전체 SDK 예제를 DeleteEndpoint보려면.java on을 참조하십시오. GitHub

HTTP

REST API에 HTTP 요청을 직접 수행하여 Amazon Pinpoint를 사용할 수 있습니다.

예 엔드포인트 DELETE 요청

엔드포인트를 삭제하려면 엔드포인트 리소스에 DELETE 요청을 발행합니다.

DELETE /v1/apps/application-id/endpoints/endpoint-id HTTP/1.1 Host: pinpoint.us-east-1.amazonaws.com Content-Type: application/json Accept: application/json Cache-Control: no-cache

위치:

  • application-id는 엔드포인트가 포함된 Amazon Pinpoint 프로젝트의 ID입니다.

  • endpoint-id는 삭제할 엔드포인트의 ID입니다.

이 요청에 대한 응답은 삭제한 엔드포인트의 JSON 정의입니다.