Create App entry using Airpush rest API (httppost i think...)

Bret

Новичок
Регистрация
21.10.2014
Сообщения
5
Благодарностей
0
Баллы
1
Im having real probs using the Airpush Publisher API. The URL im ok with however when i submit my parameters with zennoposters http post request I get a return of

HTTP/1.1 200 OK Content-Type: text/json Date: Tue, 21 Oct 2014 11:12:08 GMT Server: nginx/1.5.3 X-Mashery-Responder: prod-j-worker-us-west-1c-27.mashery.com X-Powered-By: PHP/5.4.26 Content-Length: 53 Connection: keep-alive

{"status":"4043","message":"No Parameters received."}

The API Guide states the following

Airpush Publisher API has been designed to let publishers manage applications directly with REST APIs.

Sample APIs
The below mentioned sample url will be used for all requests.

Sample Url: http://openapi.airpush.com/<METHOD NAME>?openapikey=<API KEY>&<BODY PARAMETER>

Adding Application
Method Name: addApplication

Body Parameter:

Parameter Name is application and

Value is

{
"appName": "New_app_name",
"appType": "Android Market URL",
"appUrl": "https://play.google.com/store/apps/details?id=xyz",
"category": "Automotive",
"subCategory": "Auto Parts",
"pushAds": {
"targettedUsers": "ALL",
"adFrequency": "2",
"firstAdDelay": "1"
},
"iconAds": {
"adsPerUser": "3"
},
"smartWall": {
"appwallAds": "N",
"dialogAds": "N",
"landingPageAds": "Y",
"richMediaFullPageAds": "N",
"overlayAds": "Y",
"videoAds": "N"
},
"bannerAds": "Y",
"excludeDatingCampaigns": "N"
}



I really hope someone can help cheers
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
maybe the body has to be without new lines and urlencoded before request.
 

Bret

Новичок
Регистрация
21.10.2014
Сообщения
5
Благодарностей
0
Баллы
1
ive tried that, same response:( tried asking thier support and got this back "Our APIs are REST APIs. You can use it with any language. You only need to call the URL with the required JSON as parameter. You will get the response back in JSON format.."

have also tried

string str = project.Variables["data"].Value;
string url = project.Variables["url"].Value;
var resultHttpPost = ZennoPoster.HttpPost(url, str, "application/json", "", "utf-8", ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody, 30000, "", "", true, 5);
return resultHttpPost;

same responce, stumped
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
the right request should start with http://openapi.airpush.com/addApplication?openapikey={your api key}&application={urlencoded json (without \r\n\s\t beetwen objects(not in text objects)}
example of data (not urlencoded)
Код:
{"appName":"test","appType":"Android Market URL","appUrl":"https://play.google.com/store/apps/details?id=ginlemon.flowerfree","category":"Automotive","subCategory":"AutoParts","pushAds":{"targettedUsers":"ALL","adFrequency":"2","firstAdDelay":"1"},"iconAds":{"adsPerUser":"3"},"smartWall":{"appwallAds":"N","dialogAds":"N","landingPageAds":"Y","richMediaFullPageAds":"N","overlayAds":"Y","videoAds":"N"},"bannerAds":"Y","excludeDatingCampaigns":"N"}
enjoy new errors ))))
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
I'm tired of helping you. One thing I can say, with my help, you're so close to the door that you've broken your nose. Read my previos post again and again and again untill you get another response from server.
 

Bret

Новичок
Регистрация
21.10.2014
Сообщения
5
Благодарностей
0
Баллы
1
Please dont give up, the last post was urlencoded when i posted it but the forum converted it back.
Would you call this from the httppost icon or use c# code.?
I have tried both with url encoded and not. Nothing. i have tried having all the info in the url and not in the passed data, nothing, i have putting the url+parameters in internet window but i allways get the same responce. I have even been trying a much simpler command
View Application
Method Name: getApplicationDetailsById

Body Parameter:

Parameter Name is application and

Value is

{
"applicationId": "your_appId"
}

and still i cant get the parameters to pass. I used an online url encoder but no matter what i get the same return
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
Sory, I have deleted the test. If it helps you, I've used the fiddler request composer with get reqest and Content-Type: application/json header.
Don't use the zp methods until you get the successful result in fiddler or any other program
 

Bret

Новичок
Регистрация
21.10.2014
Сообщения
5
Благодарностей
0
Баллы
1
Ok cool I got it!!! WOOP WOOP, for anyone following, ill be dammed if i know why but i used a get request not post and the url was as mentioned above but everything between the initial{} brackets for the json parameters must be url encoded. Also fiddler rocks... Thanks LexxWork
 

LexxWork

Client
Регистрация
31.10.2013
Сообщения
1 190
Благодарностей
791
Баллы
113
You don't have to use post request because body is nul, in a future you can get an error, I think so. Try use get request - in this situation it should work.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)