Sign up FREE & get 250 points
 More options
1 2 3 4 5 6 7
Created: 2011-06-17 05:19:43
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
We will consider adding a remove or hide application feature.

By design we don't add the ? in the redirect URI. You can append the ? to the redirect_uri GET parameter yourself. Please take a look at the example PHP applicationwe have provided.bngsudheer


Sounds good!

I read the example again and did notice 'http://p2soauthclient.example.com/back.php?' as the domain.

Thanks again!
'Build a better idiot proof system and the universe will build a better idiot...'
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
Matjong, I will definitely be needing a way to access a users points/cash/merits/tickets/messages as well as a way to send messages from one user to another.The basic info is a good start, but just isn't enough.

I'm also having an issue with the oauth token. i get the code just fine by authorizing the application and use it to request the token. When I get the response back I get an OK (200) but the actual JSON is:

{"error" :"unauthorized"}

It seems as though it thinks the application is not authorized to request info, when it does appear on my authorized application list.
'Build a better idiot proof system and the universe will build a better idiot...'
bngsudheer
IN admin
Getting Chatty
Total posts: 20
Status: Offline
Date of Birth: 1981-10-11
Total Earnings: $-0.57
Matjong, I will definitely be needing a way to access a users points/cash/merits/tickets/messages as well as a way to send messages from one user to another.The basic info is a good start, but just isn't enough.[QUOTE]

We will add these API end points soon.

[QUOTE]I'm also having an issue with the oauth token. i get the code just fine by authorizing the application and use it to request the token. When I get the response back I get an OK (200) but the actual JSON is:

{"error" :"unauthorized"}

It seems as though it thinks the application is not authorized to request info, when it does appear on my authorized application list.ldpx3000


Which API end point are you trying to access?
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
I'm getting this from the OAUTH Token - http://www.points2shop.com/oauth/token , the step right before I actually request the information.
'Build a better idiot proof system and the universe will build a better idiot...'
bngsudheer
IN admin
Getting Chatty
Total posts: 20
Status: Offline
Date of Birth: 1981-10-11
Total Earnings: $-0.57
I'm getting this from the OAUTH Token - http://www.points2shop.com/oauth/token , the step right before I actually request the information.ldpx3000


Please make sure you are sending the POST parameters code, client_id and client_secret with appropriate values to http://www.points2shop.com/oauth/token'.
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
I have done this numerous times and still returns the same.
I am at a loss as to what I am missing. I know it's returning OK because if I do

if(tokenResponse.StatusCode == HttpStatusCode.OK){'code here';}

it always reaches the inner code at which point I am to assume that it has connected correctly but I am just not authorized to receive the data.

I also don't have any problem setting the headers, sending the request and receiving the response as I can receive the shoutbox API info just fine

I will continue to dig away at the problem.

Thank you
'Build a better idiot proof system and the universe will build a better idiot...'
bngsudheer
IN admin
Getting Chatty
Total posts: 20
Status: Offline
Date of Birth: 1981-10-11
Total Earnings: $-0.57
I have done this numerous times and still returns the same.
I am at a loss as to what I am missing. I know it's returning OK because if I do

if(tokenResponse.StatusCode == HttpStatusCode.OK){'code here';}

it always reaches the inner code at which point I am to assume that it has connected correctly but I am just not authorized to receive the data.

I also don't have any problem setting the headers, sending the request and receiving the response as I can receive the shoutbox API info just fine

I will continue to dig away at the problem.

Thank youldpx3000


What are the post parameters you are sending to http://www.points2shop.com/oauth/token? Please mention the parameter names.

We've made some improvements in error reporting. We will deploy the improvements soon. Hopefully, the improved error messages will give some insight into where the request is failing.
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
Here are the headers I am sending in the request -

code: ***********************************************
client_id: 42.o.points2shop.com
client_secret: *************************************
Content-Type: application/json
Host: www.points2shop.com
Connection: Keep-Alive

(I removed the hashes before posting on the forum)

and the JSON i get back from the request -

{"error": "unauthorized"}

Thanks for the improvements in error reporting. I'm sure they will help me pinpoint where the problem is. The REST API works great btw.
'Build a better idiot proof system and the universe will build a better idiot...'
bngsudheer
IN admin
Getting Chatty
Total posts: 20
Status: Offline
Date of Birth: 1981-10-11
Total Earnings: $-0.57
Here are the headers I am sending in the request -

code: ***********************************************
client_id: 42.o.points2shop.com
client_secret: *************************************
Content-Type: application/json
Host: www.points2shop.com
Connection: Keep-Alive

(I removed the hashes before posting on the forum)

and the JSON i get back from the request -

{"error": "unauthorized"}

Thanks for the improvements in error reporting. I'm sure they will help me pinpoint where the problem is. The REST API works great btw.ldpx3000


Now, I see the problem. code, client_id and client_secret should be sent as HTTP POST parameters. You are sending them as HTTP headers.

However, in the REST API, the key has to be sent as an HTTP header.
ldpx3000
US moderator
Points2shop is my specialty
Total posts: 1117
Status: Offline
Ok, I think I found what my problem was. Is the API down at the moment? I keep getting 500 server errors

[EDIT] - Everything is working fine now. Thank you!
'Build a better idiot proof system and the universe will build a better idiot...'

1 2 3 4 5 6 7
You are not logged in.

Chat History

will load when you scroll to the bottom