question

fabaunet13 avatar image
0 Likes"
fabaunet13 asked ·

Comment rafraichir le jeton (token) OAuth en php ?

Bonjour,

J'ai testé la procédure suivante :

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.ebay.com/buy/browse/v1/item_summary/search?limit=10&offset=&sort=price&gtin=3528707865939",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"X-EBAY-C-MARKETPLACE-ID: EBAY-FR",
"X-EBAY-C-ENDUSERCTX: affiliateCampaignId=<CAMPAIGNID>,affiliateReferenceId=<SUBID>",
"Authorization: Bearer <TOKEN>"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;


Cela fonctionne mais le <TOKEN> utilisé ( récupéré sur le compte développeur ) ne dépasse pas 2 heures ... Comment le rafraichir automatiquement par code php ?

Merci d'avance.

Fabrice

refresh token rest apioauth token
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.