{"action":"created","issue":{"url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/30","repository_url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php","labels_url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/30/comments","events_url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/30/events","html_url":"https://github.com/fillup/walmart-partner-api-sdk-php/issues/30","id":192967004,"number":30,"title":"Trying to get first test script running","user":{"login":"mgatten","id":3322138,"avatar_url":"https://avatars.githubusercontent.com/u/3322138?v=3","gravatar_id":"","url":"https://api.github.com/users/mgatten","html_url":"https://github.com/mgatten","followers_url":"https://api.github.com/users/mgatten/followers","following_url":"https://api.github.com/users/mgatten/following{/other_user}","gists_url":"https://api.github.com/users/mgatten/gists{/gist_id}","starred_url":"https://api.github.com/users/mgatten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgatten/subscriptions","organizations_url":"https://api.github.com/users/mgatten/orgs","repos_url":"https://api.github.com/users/mgatten/repos","events_url":"https://api.github.com/users/mgatten/events{/privacy}","received_events_url":"https://api.github.com/users/mgatten/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-01T21:27:46Z","updated_at":"2016-12-06T02:07:40Z","closed_at":null,"body":"I'm just starting an integration project, and I came across your library. Thank you SO MUCH for doing all the heavy lifting!\r\n\r\nJust to confirm connectivity, I wrote a quick test script. It's getting a 401, and I'm not sure where to start troubleshooting. Perhaps you have a suggestion?\r\n\r\n```\r\n<?php\r\nputenv(\"CONSUMER_ID=b8e189.....\"); // Truncated for security                      \r\nputenv(\"PRIVATE_KEY=MIICdw.....\"); // Truncated for security                      \r\n\r\nrequire(\"vendor/autoload.php\");\r\nuse Walmart\\Feed;\r\n\r\n$client = new Feed([\r\n        'consumerId' => getenv('CONSUMER_ID'),\r\n        'privateKey' => getenv('PRIVATE_KEY'),\r\n    ],\r\n    Feed::ENV_STAGE\r\n);\r\n\r\n$feeds = $client->list([\r\n    'limit' => 50, // optional, default 50\r\n    'offset' => 0, // optional, default 0\r\n]);\r\n\r\nprint_r($feeds);\r\n?>\r\n\r\n```\r\n\r\nThe output generated when I run that from the command line:\r\n\r\n```\r\nFatal error: Uncaught exception 'GuzzleHttp\\Exception\\ClientException' with message 'Client error response [url] https://marketplace.stg.walmartapis.com/v2/feeds?limit=50&offset=0 [status code] 401 [reason phrase] Unauthorized' in /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:89\r\nStack trace:\r\n#0 /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/guzzle/src/Subscriber/HttpError.php(33): GuzzleHttp\\Exception\\RequestException::create(Object(GuzzleHttp\\Message\\Request), Object(GuzzleHttp\\Message\\Response))\r\n#1 /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/guzzle/src/Event/Emitter.php(108): GuzzleHttp\\Subscriber\\HttpError->onComplete(Object(GuzzleHttp\\Event\\CompleteEvent), 'complete')\r\n#2 /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/guzzle/src/RequestFsm.php(91): GuzzleHttp\\Event\\Emitter->emit('complete', Object(GuzzleHttp\\Event\\CompleteEvent))\r\n#3 /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/g in /home/mbws/public_html/commhub/chtg/walmart/api/vendor/guzzlehttp/command/src/AbstractClient.php on line 171\r\n```\r\n\r\nBy putting a \"die()\" in various spots, I've confirmed that this is being generated by the \"$feeds = $client...\" command. The script remains silent up to that point. \r\n\r\nWhat am I missing?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/comments/265039709","html_url":"https://github.com/fillup/walmart-partner-api-sdk-php/issues/30#issuecomment-265039709","issue_url":"https://api.github.com/repos/fillup/walmart-partner-api-sdk-php/issues/30","id":265039709,"user":{"login":"fillup","id":556105,"avatar_url":"https://avatars.githubusercontent.com/u/556105?v=3","gravatar_id":"","url":"https://api.github.com/users/fillup","html_url":"https://github.com/fillup","followers_url":"https://api.github.com/users/fillup/followers","following_url":"https://api.github.com/users/fillup/following{/other_user}","gists_url":"https://api.github.com/users/fillup/gists{/gist_id}","starred_url":"https://api.github.com/users/fillup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fillup/subscriptions","organizations_url":"https://api.github.com/users/fillup/orgs","repos_url":"https://api.github.com/users/fillup/repos","events_url":"https://api.github.com/users/fillup/events{/privacy}","received_events_url":"https://api.github.com/users/fillup/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T02:07:40Z","updated_at":"2016-12-06T02:07:40Z","body":"Are you sure the consumerId and secret you are using is for the staging environment? You should have different credentials for staging and production but they are probably not the same. \r\n\r\nOne other factor can be if your server is not properly configured for internet time and is off a bit. The auth signature that is generated is based on the current time, so if you're off even by a couple seconds it will be wrong to Walmart. "}}
{"actor":{"display_login":"fillup"}}