UNable to connect with Rest Client tool

52 views
Skip to first unread message

Sandeep R

unread,
Mar 23, 2016, 6:37:09 AM3/23/16
to LCP API Community
HI team,

I am using the below request from Rest client in Chrome browser 

curl -X POST -i -H 'Content-Type: application/json' -H 'Authorization: MAC id="2a8e2820e77e4ed9aa9a8c9c3ea9069a", ts="1458728821", nonce="cmj3TU5u", ext="a8598e267dbba7c29c9e0a43f1ac96378d0bff5a", mac="y5uetpLurRMfRgqCeJknt7v2CSI="' -d '{"identifyingFactors": {"memberId": "857AWL2"}, "authenticatingFactors": {"password": "xxxx123"}}' https://sandbox-staging.lcp.points.com/v1/lps/4680392e-6479-4c6b-916a-cdf21a9e1337/mvs


I am receiving the below error. PLease let me know what mistake I am doing
{"errors": [{"code": "UNAUTHORIZED","description": "The server could not verify that you are authorized to access the URL requested.","field": null}]}


lcp_try.png

Jeff Byrne

unread,
Mar 23, 2016, 8:35:03 AM3/23/16
to LCP API Community
Hi Sandeep,

It looks like you're using credentials for the regular sandbox environment with our staging environment. Can you please try the same request using the following URL:


Jeff Byrne
Product Manager, Loyalty Commerce Platform

Sandeep R

unread,
Mar 23, 2016, 10:06:17 AM3/23/16
to LCP API Community
HI Jeff ,
Thanks for getting back.
I tried again with sanbox login.. Still getting the same error.. Please help me in resolving this issue.

curl -X POST -i -H 'Content-Type: application/json' -H 'Authorization: MAC id="2a8e2820e77e4ed9aa9a8c9c3ea9069a", ts="1458741749", nonce="QkTfC2mx", ext="a8598e267dbba7c29c9e0a43f1ac96378d0bff5a", mac="cJg4aI5eNgk3YKf4SA4/xVot3Ms="' -d '{"identifyingFactors": {"memberId": "857AWL2"}, "authenticatingFactors": {"password": "xxxx123"}}' https://sandbox.lcp.points.com/v1/lps/4680392e-6479-4c6b-916a-cdf21a9e1337/mvs

Jeff Byrne

unread,
Mar 23, 2016, 10:59:55 AM3/23/16
to LCP API Community
Hi Sandeep,

The most recent request was rejected by our system due to a timestamp that was too out-of-sync with our servers. Please follow these instructions to sync your clock to the same source we use and try again.

Jeff Byrne
Product Manager, Loyalty Commerce Platform

Sandeep R

unread,
Mar 23, 2016, 12:54:17 PM3/23/16
to LCP API Community
HI Jeff,
I synced the clock as per instruction and again tried with the same request. 
curl-X POST -i 
-H 'Content-Type: application/json' 
-H 'Authorization: MAC id="2a8e2820e77e4ed9aa9a8c9c3ea9069a", ts="1458751999", nonce="u5X9drT5", ext="a8598e267dbba7c29c9e0a43f1ac96378d0bff5a", mac="TP24EaHxCGec0MtdT9ejs6KU40g="'
-d '{"identifyingFactors": {"memberId": "857AWL2"}, "authenticatingFactors": {"password": "Reward123"}}' 
https://sandbox.lcp.points.com/v1/lps/4680392e-6479-4c6b-916a-cdf21a9e1337/mvs


Now I am getting a different error as below

{"errors": [{"code": "NOT_FOUND","description": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.","field": null}]}

Jeff Byrne

unread,
Mar 23, 2016, 1:32:44 PM3/23/16
to LCP API Community
Hi Sandeep,

Apologies, I gave an invalid URL in my earlier response that was missing a forward slash at the end. You should be POSTing to the following:


Additionally, your recent attempts are being rejected again due to an invalid timestamp on the request header; some of the requests have been out of sync by over five minutes. Please ensure that your system clock is synced properly as mentioned in my previous response.

Jeff Byrne
Product Manager, Loyalty Commerce Platform

Sandeep R

unread,
Mar 23, 2016, 2:26:20 PM3/23/16
to LCP API Community
Thanks Jeff for updating,
I again tried with the same.. NOw getting a error that member is not found.. But I am able to login with the same credentials in AmericanAdvantage website.

Also AAdvantage does not require first name. However if I skip firstName parameter, its giving an error.

{"identifyingFactors": {"memberId": "857AWL2", "firstName":"Kofi","lastName":"Ampadu"}, "authenticatingFactors": {"password": "Reward123"}}

Response

{"errors": [{"code": "UNKNOWN_MEMBER","description": "No member could be found with the given credentials."}]}

Jeff Byrne

unread,
Mar 23, 2016, 2:44:33 PM3/23/16
to LCP API Community
Hi Sandeep,

Sandbox mode does not actually connect with the loyalty program itself, rather it is configured to return certain pre-determined responses for different accounts, you can read more about that in our documentation here. You'll need to do a GET on the following endpoint to find the sandbox responses set up for this loyalty program:


Jeff Byrne
Product Manager, Loyalty Commerce Platform

Sandeep R

unread,
Mar 23, 2016, 3:48:53 PM3/23/16
to LCP API Community
THanks a lot Jeff. Now it makes sense.
Can you let me know how do we create a live account.


On Thursday, March 24, 2016 at 12:14:33 AM UTC+5:30, Jeff Byrne wrote:
Hi Sandeep,

Sandbox mode does not actually connect with the loyalty program itself, rather it is configured to return certain pre-determined responses for different accounts, you can read more about that in our documentation here. You'll need to do a GET on the following endpoint to find the sandbox responses set up for this loyalty program:


Jeff Byrne
Product Manager, Loyalty Commerce Platform

On Wednesday, March 23, 2016 at 2:26:20 PM UTC-4, Sandeep R wrote:
Thanks Jeff for updating,
I again tried with the same.. NOw getting a error that member is not found.. But I am able to login with the same credentials in AmericanAdvantage website.

Also AAdvantage does not require first name. However if I skip firstName parameter, its giving an error.

{"identifyingFactors": {"memberId": "857AWL2", "firstName":"Kofi","lastName":"Ampadu"}, "authenticatingFactors": {"password": "xxxx123"}}

Response

{"errors": [{"code": "UNKNOWN_MEMBER","description": "No member could be found with the given credentials."}]}




On Wednesday, March 23, 2016 at 11:02:44 PM UTC+5:30, Jeff Byrne wrote:
Hi Sandeep,

Apologies, I gave an invalid URL in my earlier response that was missing a forward slash at the end. You should be POSTing to the following:


Additionally, your recent attempts are being rejected again due to an invalid timestamp on the request header; some of the requests have been out of sync by over five minutes. Please ensure that your system clock is synced properly as mentioned in my previous response.

Jeff Byrne
Product Manager, Loyalty Commerce Platform

On Wednesday, March 23, 2016 at 12:54:17 PM UTC-4, Sandeep R wrote:
HI Jeff,
I synced the clock as per instruction and again tried with the same request. 
curl-X POST -i 
-H 'Content-Type: application/json' 
-H 'Authorization: MAC id="2a8e2820e77e4ed9aa9a8c9c3ea9069a", ts="1458751999", nonce="u5X9drT5", ext="a8598e267dbba7c29c9e0a43f1ac96378d0bff5a", mac="TP24EaHxCGec0MtdT9ejs6KU40g="'
-d '{"identifyingFactors": {"memberId": "857AWL2"}, "authenticatingFactors": {"password": "xxxx123"}}' 
https://sandbox.lcp.points.com/v1/lps/4680392e-6479-4c6b-916a-cdf21a9e1337/mvs
Reply all
Reply to author
Forward
0 new messages