skip to Main Content

I am trying to interface my php code with AWS Marketplace. There seems to be no example in PHP, anywhere.

$client = new MarketplaceMeteringMarketplaceMeteringClient($config);
$request = array();
$request['ProductCode']=ProductCode;
$request['Filter']['CUSTOMER_IDENTIFIER']=$result['CustomerIdentifier'];
$entitlement = $client->GetEntitlements( $request);

I am getting the following error and don’t know why?

Type: InvalidArgumentException

Message: Operation not found: GetEntitlements

Filename: /app/vendor/aws/aws-sdk-php/src/AwsClient.php

2

Answers


  1. Chosen as BEST ANSWER

    I should have used this $marketplaceentitlementservice = new MarketplaceEntitlementServiceClient($config);

    instead of the MarketplaceMeteringClient.


  2. You need to use MarketplaceEntitlementServiceClient to interact with the AWS Marketplace Entitlement Service. It supports GetEntitlements operation.

    $result = $client->getEntitlements([/* ... */]);
    $promise = $client->getEntitlementsAsync([/* ... */]);
    

    Hope it helps.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search