Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect): Array ( ) Expected param 'tracking_code'. #57

Open
Gzhuise opened this issue Jul 15, 2020 · 1 comment

Comments

@Gzhuise
Copy link

Gzhuise commented Jul 15, 2020

I am getting this error when submit tracking code through ETSY API :
Any help would be greatly appreciated !

Etsy\EtsyRequestException
Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect): Array
(
)
Expected param 'tracking_code'.Array
(
[http_code] => 400
[content_type] => text/plain;charset=UTF-8
[url] => https://openapi.etsy.com/v2/private/shops/xxxxxx/receipts/169999999/tracking?oauth_consumer_key=xxxxxxxx&oauth_signature_method=HMAC-SHA1&oauth_nonce=-xxxxxxxx&oauth_timestamp=1594779809&oauth_version=1.0&oauth_token=xxxxxxxx&oauth_signature=xxxxxxxx
[header_size] => 955
[request_size] => 403
[filetime] => -1
[ssl_verify_result] => 20
[redirect_count] => 0
[total_time] => 1.063
[namelookup_time] => 1.0E-6
[connect_time] => 0.219
[pretransfer_time] => 0.641
[size_upload] => 0
[size_download] => 31
[speed_download] => 29
[speed_upload] => 0
[download_content_length] => 31
[upload_content_length] => -1
[starttransfer_time] => 1.063
[redirect_time] => 0
[headers_recv] => HTTP/1.1 400 Bad Request
Connection: keep-alive
Content-Length: 31
Server: Apache
Set-Cookie: uaid=xxxxxxxx.; expires=Thu, 15-Jul-2021 02:10:31 GMT; Max-Age=31536000; path=/; domain=.etsy.com; secure
X-CLOUD-TRACE-CONTEXT: 2afb84d81257d72489a613e75de0b6a1/372768447438560266;o=0
X-Etsy-Request-Uuid: xxxxxxxx
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9449
X-Error-Detail: Expected param 'tracking_code'.
Cache-Control: private
Set-Cookie: user_prefs=xxxxxxxx.; expires=Thu, 15-Jul-2021 02:10:31 GMT; Max-Age=31536000; path=/; domain=.etsy.com
Content-Type: text/plain;charset=UTF-8
Via: 1.1 google
Accept-Ranges: bytes
Date: Wed, 15 Jul 2020 02:10:31 GMT
Via: 1.1 varnish
X-Served-By: cache-hkg17929-HKG
X-Cache: MISS
X-Cache-Hits: 0
X-Timer: S1594779031.219571,VS0,VE214

)
.........
Caused by: OAuthException
Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)

My action code :

$return = $this->api->submitTracking(array(
            'params' => array(
                "shop_id"=> "xxxxx",
	     "receipt_id"=> "16999999",				
               "tracking_code"=>"9400109202020999999999",
                "carrier_name"=> "4px",
            )));
print_r($return);
@shopifychamp
Copy link
Contributor

Hi Gzhuise,
You need to put post content in data index for post/put request. Please refer below code:

$return = $this->api->submitTracking(
       array(
            'params' => array(
                 "receipt_id"=> "16999999",	
            ),
           'data' => array(
                  "tracking_code"=>"9400109202020999999999",
                  "carrier_name"=> "4px",
            )
      )
);
print_r($return);

Please let me know if you need any help.

Thanks
Kshitij

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants