Level 2
help anyone?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey Guys
im new to Guzzle and godaddy API. goDaddy has a test environment in which to test your API calls. I have successfully made a domain purchase in the test enivornment. When i now do this on Guzzle i get an Auth error 401.
My Controller:
$headers = ['Authorization' => 'sso-key $api_key:$api_secret'];
$client = new \GuzzleHttp\Client();
$response = $client->post($url, [
'headers' => $headers,
'form_params' => $bodyContent
]);
$data=json_decode((string)$response->getBody());
dd($data);
Route:
Route::get('/domainpurchase',[
'uses'=>'GoDaddyController@PurchaseDomain',
]);
I have not shown the $bodyContent variable but its a Multidimentional array and it passes successfully on the posted on the goDaddy environment
The goDaddy API can be found here:https://developer.godaddy.com/doc/endpoint/domains#/v1/purchase
Please or to participate in this conversation.