Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinpoint error on PutEvents when decode JSON Response ? #389

Closed
togro opened this issue Jun 12, 2020 · 2 comments
Closed

Pinpoint error on PutEvents when decode JSON Response ? #389

togro opened this issue Jun 12, 2020 · 2 comments

Comments

@togro
Copy link

togro commented Jun 12, 2020

Hi

We are sending track for users to backend ,message are delivered, but response fail with this error :

Attribute (EventsResponse) does not pass the type constraint because: Validation failed for 'Paws::Pinpoint::EventsResponse' with value {"Results":{"bel":{"EndpointItemResponse":{"StatusCode":202,"Message":"Accepted"},"EventsItemResponse":{"boletatest":{"StatusCode":202,"Message":"Accepted"}}}}} (not isa Paws::Pinpoint::EventsResponse) at perl5/perlbrew/perls/perl-5.24.4/lib/site_perl/5.24.4/x86_64-linux/Moose/Object.pm line 24

What may be causing this problem?

@castaway
Copy link
Collaborator

Can you please include your calling code and installed version of Paws?

@togro
Copy link
Author

togro commented Jun 15, 2020

Paws Version : 0.41

use Data::Dumper;
use File::Slurp;
use Paws;
use Paws::Pinpoint::EventsResponse;
use DateTime;

my $pinpoint = Paws->service('Pinpoint', region => 'us-east-1', debug => 1);

#
my $dt =  DateTime->now;

my $res=  $pinpoint->PutEvents(
	    ApplicationId => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
	    EventsRequest => {
          BatchItem => {
            'Map' => {
                         Endpoint => {
                           
                          Address    => 'prueba_recipient_id',
                          # Attributes => { 'My__string' => [ 'My__string',  ], }
                          # ,    # OPTIONAL
                          ChannelType => 'CUSTOM',
                          # Demographic => {
                          #   AppVersion      => 'My__string',
                          #   Locale          => 'My__string',
                          #   Make            => 'My__string',
                          #   Model           => 'My__string',
                          #   ModelVersion    => 'My__string',
                          #   Platform        => 'My__string',
                          #   PlatformVersion => 'My__string',
                          #   Timezone        => 'My__string',
                          # },    # OPTIONAL
                          # EffectiveDate  => 'My__string',
                          # EndpointStatus => 'INACTIVE',
                          # Location       => {
                          #   City       => 'My__string',
                          #   Country    => 'My__string',
                          #   Latitude   => 1,              # OPTIONAL
                          #   Longitude  => 1,              # OPTIONAL
                          #   PostalCode => 'My__string',
                          #   Region     => 'My__string',
                          # },    # OPTIONAL
                          # Metrics => {
                          #   'My__string' => 1,    # , value: OPTIONAL
                          # },    # OPTIONAL
                          # OptOut    => 'My__string',
                          RequestId => 'My__string',
                          User      => {
                            # UserAttributes => { 'My__string' => [ 'My__string',  ], }
                            # ,    # OPTIONAL
                            UserId => 'agente02',
                          },    # OPTIONAL
                        },
                        Events => {
                          'Map' => {
                            EventType      => 'PRUEBA',
                            Timestamp      => $dt->iso8601(),
                            # AppPackageName => 'My__string',
                            AppTitle       => 'MyApp',
                            AppVersionCode => '1.0',
                            # Attributes     => { 'My__string' => 'My__string', },  # OPTIONAL
                            # ClientSdkVersion => 'My__string',
                            Attributes          => {
                              'TIPODOC' => 'PRUEBA',    # , value: OPTIONAL
                              'EMPRESA' => 'xxxxxx-9'
                            },    # OPTIONAL
                            Metrics          => {
                              'cuenta1' => 2002,    # , value: OPTIONAL
                              'cuenta2' => 233
                            },
                            # SdkName => 'My__string',
                            #  Session => {
                            #    Id             => 'My__string',
                            #    StartTimestamp => 'My__string',
                            #    Duration       => 1,              # OPTIONAL
                            #    StopTimestamp  => 'My__string',
                            #  },    # OPTIONAL
                          },
                        },
            },
          },
      
      },
  );

@togro togro closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants