Linked Questions

Popular Questions

I am trying to get the column and rows for customers from an AWS Pinpoint segment. To do so I used the boto3 SDK. Its my understanding from the docs that the get_segment method will contain the data for the segment in the attribute and dimension keys .When I try to load the attributes and dimension from an AWS Pinpoint segment using boto3 in an lambda function the dimensions and attributes show up as empty.

here is what my code looks like:

client = boto3.client('pinpoint',region_name='us-east-1')

response = client.get_segment(
        ApplicationId=appid,
        SegmentId=segment_id
    )
    
    print(response)

the response I am getting is this:

"SegmentResponse":{
      "ApplicationId":,
      "Arn":,
      "CreationDate":"2023-05-25T13:48:41.464Z",
      "Dimensions":{
         "Attributes":{
            
         },
         "Behavior":{
            
         },
         "Demographic":{
            
         },
         "Location":{
            
         },
         "UserAttributes":{
            
         }
      },
      "Id":,
      "LastModifiedDate":"2023-05-25T13:50:51.675Z",
      "Name":"test 1",
      "SegmentGroups":{
         "Groups":[
            {
               "Dimensions":[
                  {
                     "Attributes":{
                        
                     },
                     "Behavior":{
                        
                     },
                     "Demographic":{
                        
                     },
                     "Location":{
                        
                     },
                     "Metrics":{
                        
                     },
                     "UserAttributes":{
                        
                     }
                  }
               ],
               "SourceSegments":[
                  
               ],
               "SourceType":"ANY",
               "Type":"ANY"
            }
         ],
         "Include":"ALL"
      },
      "SegmentType":"DIMENSIONAL",
      "tags":{
         
      },
      "Version":3
   }

As you can see the dimensions and attributes are empty. When I create an export for the segment, the csv file populates properly and the correct data is given out with the correct format as well. The segment created is dynamic and uses the imported static segment as the base. If there is an error with the format then it wont take the csv file as an upload.

*ApplicationId, Id and Arn show up fine in the response. I took it off for security reasons.

When I tried pulling the data with the static up csv as the input, the Attributes and Dimension fields dont show up. I created another segment using the static segment as the base since the new segment would end up being dynamic. The dynamic segment then at least had the dimensions and attribute fields show up, but it is still empty.

Related Questions