Why do the AWS Pinpoint endpoints become INACTIVE without making them so?

0

Hello,

I am using the AWS JavaScript SDK to create endpoints. I have an AWS Lambda which has logic that creates an endpoints. I call the Lambda via GraphQL when a user is created so that the user gets an endpoint on creation. I setup the all users to have an active endpoint but literaly after a few minutes of creation every user's endpoint becomes INACTIVE. Why is that the case?

Here is the code I use to create the endpoint:


const { Pinpoint } = require("aws-sdk");
const AWS = require("aws-sdk")
const pinpoint = new AWS.Pinpoint(); 

exports.handler = async (event) => {
    
    const marketing = event.arguments.marketing;
    const typeAction = event.arguments.typeAction;
    const endpointAddress = event.arguments.address;
    const projectId = projectID;
    const valueAction = event.arguments.valueAction;

    const endpointID = generateEndpointID(20);


    const params = {
        ApplicationId: projectId, /* required */
        EndpointId: endpointID, /* required */
        EndpointRequest: { /* required */
          Address: endpointAddress,
          Attributes: {
            typeAction : [typeAction],
            valueAction : [valueAction],
            marketing : [marketing],
          },
          ChannelType: "EMAIL",
          EndpointStatus: 'ACTIVE',
          OptOut: 'NONE',
          User: {
            UserAttributes: {
              //
            },
            UserId: endpointAddress
          }
        }
      };

    const pinpointRes = await pinpoint.updateEndpoint(params).promise().catch(er=> {console.log(er)});
    return endpointID;
};



已提問 2 年前檢視次數 741 次
2 個答案
0

Amazon Pinpoint automatically sets this value to INACTIVE if you update another endpoint that has the same address specified by the Address property.

Reference: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Pinpoint.html#updateEndpoint-property

Please see for every email address once endpoint is created, after few mins somewhere in the flow creates/updates endpoint for the same email address.

prabu
已回答 2 年前
0

after adding an endpoint with an address that already exists in your segment it will overwrite it and make the existing one INACTIVE. its to counter the duplication of addresses.

已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南