davidtsadler / ebay-sdk-examples

Several examples of using the eBay SDK for PHP
http://devbay.net
Apache License 2.0
184 stars 100 forks source link

Always getting Access token is missing in the Authorization HTTP request header. #92

Closed chouaiebTn closed 4 years ago

chouaiebTn commented 5 years ago

hello, i'm trying to use the sdk to add items to ebay inventory from our website database. i'm using the "02-create-or-replace-inventory-item.php" example with sandbox credentials. here is the server configuration :

PHP Version : 5.6.40 cURL support : enabled cURL Information : 7.66.0 Age : 5 Features AsynchDNS : Yes CharConv : No Debug : No GSS-Negotiate : No IDN : No IPv6 : Yes krb4 : No Largefile : Yes libz : Yes NTLM : Yes NTLMWB : Yes SPNEGO : Yes SSL : Yes SSPI : No TLS-SRP : Yes Protocols : dict, file, ftp, ftps, gopher, http, https, imap, imaps, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp Host : x86_64-redhat-linux-gnu SSL Version : OpenSSL/1.0.2t ZLib Version : 1.2.7 libSSH Version : libssh2/1.4.3

here is the full request debug : https://api.sandbox.ebay.com/sell/inventory/v1/inventory_item/1234001254006985 Authorization: Bearer **AUTHORISATION TOKEN REMOVED FROM HERE** Accept: application/json Content-Type: application/json Content-Length: 603 Content-Language: en-US Accept-Language: en-US {"availability":{"shipToLocationAvailability":{"quantity":50}},"condition":"NEW_OTHER","product":{"aspects":{"Brand":["GoPro"],"Type":["Helmet\/Action"],"Storage Type":["Removable"],"Recording Definition":["High Definition"],"Media Format":["Flash Drive (SSD)"],"Optical Zoom":["10x","8x","4x"]},"description":"New GoPro Hero4 Helmet Cam. Unopened box.","imageUrls":["http:\/\/i.ebayimg.com\/images\/i\/182196556219-0-1\/s-l1000.jpg","http:\/\/i.ebayimg.com\/images\/i\/182196556219-0-1\/s-l1001.jpg","http:\/\/i.ebayimg.com\/images\/i\/182196556219-0-1\/s-l1002.jpg"],"title":"GoPro Hero4 Helmet Cam"}}

Response : { "errors" : [ { "errorId" : 1002, "domain" : "OAuth", "category" : "REQUEST", "message" : "Missing access token", "longMessage" : "Access token is missing in the Authorization HTTP request header." } ] }