NAME

Apple::AppStoreConnect - Apple App Store Connect API client

VERSION

Version 0.1

SYNOPSIS

use Apple::AppStoreConnect;

my $asc = Apple::AppStoreConnect->new(
    issuer => $API_key_issuer,  # API key issuer ID
    key_id => $key_id,          # App Store Connect API key ID
    key    => $private_key      # Encrypted private key (PEM)
);

# Custom API request
my $res = $asc->get(url => $url);

# List apps / details convenience function
$res = $asc->get_apps();                                          # List of apps
$res = $asc->get_apps(id => $app_id);                             # App details
$res = $asc->get_apps(id => $app_id, path => 'customerReviews');  # App reviews

DESCRIPTION

Apple::AppStoreConnect provides basic access to the Apple App Store Connect API.

Please see the official API documentation for usage and all possible requests.

CONSTRUCTOR

new

  my $asc = Apple::AppStoreConnect->new(
      key_id     => $key_id,
      key        => $private_key?,
      key_file   => $private_key_pem?,
      issuer     => "57246542-96fe-1a63-e053-0824d011072a",
      scope      => \@scope?,
      timeout    => $timeout_sec?,
      expiration => $expire_secs?,
      ua         => $lwp_ua?,
      curl       => $use_curl?
  );

Required parameters:

Optional parameters:

METHODS

get

my $res = $asc->get(
    url    => $url,
    raw    => $raw?,
    params => \%query_params?
);

Fetches the requested API url, by default, it will use JSON to decode it directly to a Perl hash, unless you request raw result as a string.

Requires LWP::UserAgent, unless the curl option was set.

If the request is not successful, it will die throwing the HTTP::Response->status_line.

get_response

my $res = $asc->get_response(
    url    => $url,
    raw    => $raw?,
    params => \%query_params?
);

Same as get except it returns the full HTTP::Response from the API (so you can handle bad requests yourself).

CONVENIENCE METHODS

jwt

my $jwt = $asc->jwt(
    iat => $iat?,
    exp => $exp?
);

Returns the JSON Web Token string in case you need it. Will return a cached one if it has more than 5 minutes until expiration and you don't explicitly pass an exp argument.

get_apps

my $res = $asc->get_apps(
    id     => $app_id?,
    path   => $path?,
    params => \%query_params?
);

Without arguments it is similar to get(url=>"apps", fetching the list of apps, but does some extra processing to return a Perl hash with app IDs as keys and the app attributes as values.

There are optional arguments to get details of a specific app or app resource:

AUTHOR

Dimitrios Kechagias, <dkechag at cpan.org>

BUGS

Please report any bugs or feature requests either on GitHub (preferred), or on RT (via the email bug-Apple-AppStoreConnect at rt.cpan.org or web interface).

I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

GIT

https://github.com/dkechag/Apple-AppStoreConnect

LICENSE AND COPYRIGHT

This software is copyright (c) 2023 by Dimitrios Kechagias.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.