updateBasePathMapping([ 'basePath' => $basePath, 'domainName' => $domainName, 'patchOperations' => $patchOperations ]); return 'The updated base path\'s URI is: ' . $result['@metadata']['effectiveUri']; } catch (AwsException $e) { return 'Error: ' . $e['message']; } } function updateTheBasePathMapping() { $patchOperations = array([ 'op' => 'replace', 'path' => '/stage', 'value' => 'stage2' ]); $apiGatewayClient = new ApiGatewayClient([ 'profile' => 'default', 'region' => 'us-east-1', 'version' => '2015-07-09' ]); echo updateBasePathMapping( $apiGatewayClient, '(none)', 'example.com', $patchOperations); } // Uncomment the following line to run this code in an AWS account. // updateTheBasePathMapping(); // snippet-end:[apigateway.php.update_base_path_mapping.main] // snippet-end:[apigateway.php.update_base_path_mapping.complete] // snippet-sourcedescription:[Update_BasePathmapping.php demonstrates how to change a base path mapping in Amazon API Gateway.] // snippet-keyword:[PHP] // snippet-sourcesyntax:[php] // snippet-keyword:[AWS SDK for PHP v3] // snippet-keyword:[Code Sample] // snippet-keyword:[Amazon API Gateway] // snippet-service:[apigateway] // snippet-sourcetype:[full-example] // snippet-sourcedate:[2020-04-02] // snippet-sourceauthor:[pccornel (AWS)]