Hi
I'm looking for any documentation about use library Guzzle and EPO.
I tried some aproach, but fails.
Apreciate help.
Library or example for use EPO with Guzzle
-
- Posts: 11
- Joined: Mon Jun 05, 2017 5:40 pm
-
- Posts: 1298
- Joined: Thu Feb 22, 2007 5:32 pm
Re: Library or example for use EPO with Guzzle
Hi,
What exactly didn't work? As much as details you can give the more we are able to help,
Regards,
OPS support
What exactly didn't work? As much as details you can give the more we are able to help,
Regards,
OPS support
-
- Posts: 11
- Joined: Mon Jun 05, 2017 5:40 pm
Re: Library or example for use EPO with Guzzle
Hi.
I'm try to connect with guzzle.
This get error understanding
I'm try to connect with guzzle.
Code: Select all
$base_uri = 'https://ops.epo.org/3.2/';
$consumerKey = 'myconsumerkey';
$consumerSecretKey =' mysecretkey';
$client = new Client([
'base_uri' => 'https://ops.epo.org/3.2/'
]);
$request = $client->post('auth/accesstoken', null, array(
'consumerKey' => 'VFfoz7HnXxBffo263mbjaAZijWCdzFgS',
'consumerSecretKey' => 'ymwlMPJzNrlF9KuF',
'grant_type' => 'client_credentials'
));
Code: Select all
[GuzzleHttp\Exception\ClientException]
Client error: `POST https://ops.epo.org/3.2/auth/accesstoken` resulted in a `401 Unauthorized` response:
<error><code>401</code><message>Client identifier is required</message>
</error>
-
- Posts: 11
- Joined: Mon Jun 05, 2017 5:40 pm
Re: Library or example for use EPO with Guzzle
Also I tried with curl
Error
Code: Select all
$base_uri = 'https://ops.epo.org/3.2/';
$consumerKey = 'MyConSumerKey';
$consumerSecretKey = 'MySecretKey';
$authorization = base64_encode(($consumerKey.':'.$consumerSecretKey));
$tokens = curl_init();
$url = 'https://ops.epo.org/3.2/auth/accesstoken';
curl_setopt($tokens, CURLOPT_URL, $url);
curl_setopt($tokens, CURLOPT_HTTPHEADER,[
'authorization' => $authorization,
'content-type' => 'application/x-www-form-urlencoded',
'grant_type' => 'client_credentials'
]);
curl_setopt($tokens, CURLOPT_POST,true);
dd(curl_exec($tokens));
Code: Select all
<error><code>401</code><message>Client identifier is required</message>
</error>
-
- Posts: 1298
- Joined: Thu Feb 22, 2007 5:32 pm
Re: Library or example for use EPO with Guzzle
Hi,
Do you have activated OPS account? This kind of questions would be better addresses if you write to us directly than over a public forum because we need to check you user credentials.
As far as token, in OPS documentation that is liked here several times, you will find how to process your token corectly. Also, in the Announcement section in this forum we have some aditional information related to only v 3.2, so please check that.
Otherwise, maybe some use uses same tool as you and they might be of help with connecting our web service.
Regards,
OPS support
Do you have activated OPS account? This kind of questions would be better addresses if you write to us directly than over a public forum because we need to check you user credentials.
As far as token, in OPS documentation that is liked here several times, you will find how to process your token corectly. Also, in the Announcement section in this forum we have some aditional information related to only v 3.2, so please check that.
Otherwise, maybe some use uses same tool as you and they might be of help with connecting our web service.
Regards,
OPS support
-
- Posts: 11
- Joined: Mon Jun 05, 2017 5:40 pm
Re: Library or example for use EPO with Guzzle
Hi.
After problems with doc of Guzzle, and examples for use with EPO,
I have preferred to build my own class and make connections with cURL. Now everything works for me. Thank you.
Brest regards
After problems with doc of Guzzle, and examples for use with EPO,
I have preferred to build my own class and make connections with cURL. Now everything works for me. Thank you.
Brest regards