Page 1 of 2

Unable to see coupon information

Posted: Thu Feb 05, 2015 6:14 am
by Mark7294305

Hello Support
I have created some coupons on a site called Beevou. I then connect to the Beevou site using the appery platform where I can access the coupon using my app. I am having a problem where I can successfully connect to the Beevou site but I cannot see the coupons. The services page is configured as
https://beevou.net/api/vouchers/get_u...

when I do a test I get the following result
{
"total_items":0,
"total_pages":0,
"items":[

Code: Select all

 ], 
 "user_id":null 

}

The results I should be getting should be with more details about the coupons I have created.
According to the Beevou documentation I should add parameters but I don’t know where to add them on the appery platform. Here is the sample cod
public JSONObject getMyVouchers(int orderBy, int searchType,int page){
List params = new ArrayList();
params.add(new BasicNameValuePair("tag", "getMyVouchers"));
params.add(new BasicNameValuePair("orderBy", String.valueOf(orderBy)));
params.add(new BasicNameValuePair("searchPage", String.valueOf(page)));
Log.e("ORDERBY", String.valueOf(orderBy));
Log.e("SEARCHTYPE", String.valueOf(searchType));
params.add(new BasicNameValuePair("searchType", String.valueOf(searchType)));
JSONObject json = jsonParser.getJSONFromUrl(https://beevou.net/api/vouchers/get_u..., params);
return json;}
How do I configure this on the Appery platform?


Unable to see coupon information

Posted: Thu Feb 05, 2015 11:09 am
by Evgene Karachevtsev

Hello Mark,

1) Please open your service
2) Open the request tab of the service
3) Open query string if it is GET method of service or open body if POST
Here you can add each parameter and try to test one more time


Unable to see coupon information

Posted: Thu Feb 05, 2015 11:43 am
by Mark7294305

Hello Evgene
I have received the following reply from the Beevou support team

You should see your user data, if not, your client is not sending cookies to the Beevou server.

"Standard CORS requests do not send or set any cookies by default"

In order to include cookies as part of your request you must specify your client to do it (withCredentials = true; in javascript).

Can you help?


Unable to see coupon information

Posted: Thu Feb 05, 2015 5:49 pm
by Mark7294305

Could anyone else on the support team help me?


Unable to see coupon information

Posted: Thu Feb 05, 2015 6:27 pm
by Ihor Didevych

Hi Mark,

We are working on it.
I will let you know when have more information from developers team.


Unable to see coupon information

Posted: Fri Feb 06, 2015 7:40 am
by Evgene Karachevtsev

Mark

If you use jquery instead of services please try the next property for ajax call
prexhrFields: {
withCredentials: true
}/pre
example:
pre$.ajax({
url: a_cross_domain_url,
xhrFields: {
withCredentials: true
}
});/pre


Unable to see coupon information

Posted: Fri Feb 06, 2015 10:08 am
by Mark7294305

Hi Evgene
I am a bit confused. You said not to use the services but to use a JavaScript instead to connect to the URL. The method I am used to is:~

  1. Create and configure an Appery service with the url

  2. Do a test

  3. Import the results

  4. Map the required fields to my app

    You said not to use the services but to use a JavaScript instead. So what are the steps I would need to take to:~

    See the results
    Import the results
    Map the required fields to my app

    Mark


Unable to see coupon information

Posted: Fri Feb 06, 2015 10:24 am
by Mark7294305

To obtain the coupons require 2 steps:~
1.I must obtain a session key with the following url
https://beevou.net/oauth/token?grant_...

  1. I can access the coupon information by using the following url
    https://beevou.net/api/vouchers/get_u...

    So I want to:~
    See the results
    Import the results
    Map the required fields to my app
    Mark


Unable to see coupon information

Posted: Fri Feb 06, 2015 6:12 pm
by Mark7294305

Could anyone else on the support team help me today?


Unable to see coupon information

Posted: Fri Feb 06, 2015 6:35 pm
by Illya Stepanov

Hi Mark -

Unfortunately it's not very clear at this point what is works for you in Appery.io and what you have tried and what's not.

But first you need to know if Beevou supported REST connections or does it needs a JavaScript implementations for authentications methods, storing sessionTokens and so on.

As I can see you've mentioned in the link above Aouth token, you can start from here: http://devcenter.appery.io/documentat...

And check our section about how to connect 3rd party REST APIs here - http://devcenter.appery.io/tutorials/...