Google-ContentAPI
view release on metacpan or search on metacpan
L<https://developers.google.com/shopping-content/v2/quickstart>
For convenience, add your Merchant account ID to the *.json file provided by Google.
Your complete *.json file, after adding your merchant ID, will look something like this:
{
"endpoint": "https://www.googleapis.com/content/v2.1",
"merchant_id": "123456789",
"type": "service_account",
"project_id": "content-api-194321",
"private_key_id": "11b8e20c2540c788e98b49e623ae8167dc3e4a6f",
"private_key": "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----\n",
"client_email": "google@content-api.iam.gserviceaccount.com",
"client_id": "999999999",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/google%40content-api.iam.gserviceaccount.com"
}
lib/Google/ContentAPI.pm view on Meta::CPAN
# https://developers.google.com/accounts/docs/OAuth2ServiceAccount
#
my $jwt = encode_jwt(
payload => {
iss => $self->{config}->{client_email},
scope => $gapiContentScope,
aud => $gapiTokenURI,
exp => $time + 3660, # max 60 minutes
iat => $time
},
key => \$self->{config}->{private_key},
alg => 'RS256'
);
# 2) Request an access token
#
my $ua = LWP::UserAgent->new();
my $response = $ua->post($gapiTokenURI, {
grant_type => encode_entities('urn:ietf:params:oauth:grant-type:jwt-bearer'),
assertion => $jwt
});
lib/Google/ContentAPI.pm view on Meta::CPAN
L<https://developers.google.com/shopping-content/v2/quickstart>
For convenience, add your Merchant account ID to the *.json file provided by Google.
Your complete *.json file, after adding your merchant ID, will look something like this:
{
"endpoint": "https://www.googleapis.com/content/v2.1",
"merchant_id": "123456789",
"type": "service_account",
"project_id": "content-api-194321",
"private_key_id": "11b8e20c2540c788e98b49e623ae8167dc3e4a6f",
"private_key": "-----BEGIN PRIVATE KEY-----
...
-----END PRIVATE KEY-----\n",
"client_email": "google@content-api.iam.gserviceaccount.com",
"client_id": "999999999",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/google%40content-api.iam.gserviceaccount.com"
}
( run in 0.239 second using v1.01-cache-2.11-cpan-4d50c553e7e )