Error 103 on Buy query

33 views
Skip to first unread message

hiroshi

unread,
Jun 28, 2011, 5:53:06 PM6/28/11
to Empire Avenue API Discussion

Ulf Hedlund

unread,
Jun 28, 2011, 6:09:20 PM6/28/11
to empireave-ap...@googlegroups.com
On Tue, Jun 28, 2011 at 11:53 PM, hiroshi <daniel...@gmail.com> wrote:
> I'm trying call the api and getting the error 103.
>

Are you using POST for the request and not GET?

hiroshi

unread,
Jun 28, 2011, 6:15:55 PM6/28/11
to Empire Avenue API Discussion
Yes. POST.

I'm trying write a VBA code for excel. Others functions run ok. The
BUY don't.


On 28 jun, 19:09, Ulf Hedlund <u...@ulfhedlund.se> wrote:

Duleepa Wijayawardhana

unread,
Jun 28, 2011, 6:27:58 PM6/28/11
to empireave-ap...@googlegroups.com
Check your network traffic, I have no idea about VBA code but that definitely would be the server interpreting your request as GET instead of a POST

hiroshi

unread,
Jun 30, 2011, 9:30:47 AM6/30/11
to Empire Avenue API Discussion
I think is that. Because I tried the status update call and I receive
"No data specified" error, but I tried at home and office, on vba and
php, and had success only on GET calls.
Any tip/sugestion?

On 28 jun, 19:27, Duleepa Wijayawardhana <dule...@empireavenue.com>
wrote:

hiroshi

unread,
Jun 30, 2011, 11:01:23 AM6/30/11
to Empire Avenue API Discussion
Someone can send me a simple working example of a post method api call
on php or any other language?

Kevin Umbach

unread,
Jun 30, 2011, 12:07:27 PM6/30/11
to empireave-ap...@googlegroups.com
Your best bet would be to search Google for some examples or
tutorials. There are lots of php post examples out there...

Kevin

hiroshi

unread,
Jun 30, 2011, 2:08:32 PM6/30/11
to Empire Avenue API Discussion
Really!?!? I hadn't tough about...

Isn't the first time I use a post on php, or yet on vba. I used to
create spreadsheets to tweet by Excel, for example, using POST and
yes, it works, .
It's really the first time I tried to use the post on php/vba on
EMPIREAVENUE API. And this, I really doesn't found so much
information .
My questions are:
The 103 error means that the post is treated as GET?
The "No data specified" error on status update means the same?

Any suggestion?

Thanks for the answers.

kevinu

unread,
Jul 4, 2011, 8:58:44 PM7/4/11
to empireave-ap...@googlegroups.com
The 103 error means that the post is treated as GET?
No, it most likely means you are doing a GET instead of a POST as Dups has previously mentioned. 


>The "No data specified" error on status update means the same? 
No, it most likely means you are doing a GET instead of a POST as Dups has previously mentioned.



kevinu

unread,
Jul 4, 2011, 8:59:54 PM7/4/11
to empireave-ap...@googlegroups.com
Post your code and maybe someone can help you more. 

hiroshi

unread,
Jul 4, 2011, 11:03:00 PM7/4/11
to Empire Avenue API Discussion
Thanks kevinu, on VBA I'm trying something simpler like this:

Sub status()

Dim xml, eUsername, ePassword, eStatus, eResult, sURL
Dim i As Integer
Dim blwExists As Boolean


Set xml = CreateObject("MSXML2.XMLHTTP")




'get the username entered by you in named range tusername
eUsername = Range("eusername")
'get the password entered by you in named range tpasswd
ePassword = Range("epassword")



sURL = "https://api.empireavenue.com/profile/set/status?
apikey=017f784073f99616341fa8f77ae730036792003cfa6fdd03aa&username=" &
eUsername & "&password=" & ePassword & "&status=Trying to use API to
send status update"


xml.Open "POST", sURL, False

xml.setRequestHeader "Content-Type", "content=text/html;
charset=iso-8859-1"
xml.Send
sHTML = xml.responsetext
Debug.Print sHTML

Set xml = Nothing

End Sub

Ulf Hedlund

unread,
Jul 4, 2011, 11:34:44 PM7/4/11
to empireave-ap...@googlegroups.com
On Tue, Jul 5, 2011 at 5:03 AM, hiroshi <daniel...@gmail.com> wrote:
>
>    xml.Open "POST", sURL, False
>    xml.setRequestHeader "Content-Type", "content=text/html;
> charset=iso-8859-1"
>    xml.Send

I'm not that familiar with VBA, but I believe you need to set the
request header to "application/x-www-form-urlencoded" when doing a
POST request:

> xml.Open "POST", sURL, False

> xml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
> xml.Send

Daniel Morine

unread,
Jul 4, 2011, 11:40:09 PM7/4/11
to empireave-ap...@googlegroups.com
I tried
The error persists

2011/7/5 Ulf Hedlund <u...@ulfhedlund.se>

Kevin Umbach

unread,
Jul 4, 2011, 11:51:38 PM7/4/11
to empireave-ap...@googlegroups.com
I think Ulf is correct. You may also have to specify other information as well.

Here is what I'm doing in the MyEmpire iPhone app to set status. You
can see all the data that needs to be set. VBA may differ than ObjC
though.

postData is equal to the string "status=this the the status message text..."
length = length of postData string.

[request setHTTPMethod:@"POST"];
[request setValue:@"application/x-www-form-urlencoded"
forHTTPHeaderField:@"Content-Type"];
[request setValue:length forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];

Kevin Umbach

unread,
Jul 4, 2011, 11:56:03 PM7/4/11
to empireave-ap...@googlegroups.com
Forgot to mention that the URL the POST is sent to is:

https://api.empireavenue.com/profile/set/status?apikey=51000000000000000000d0&username=KEVINUM&password=secret

Notice there is no "&status" parameter in the URL.

hiroshi

unread,
Jul 7, 2011, 11:57:31 AM7/7/11
to Empire Avenue API Discussion
I'm still with error.

On 5 jul, 00:56, Kevin Umbach <kumb...@gmail.com> wrote:
> Forgot to mention that the URL the POST is sent to is:
>
> https://api.empireavenue.com/profile/set/status?apikey=51000000000000...
>
> Notice there is no "&status" parameter in the URL.
>
>
>
>
>
>
>
> On Mon, Jul 4, 2011 at 9:51 PM, Kevin Umbach <kumb...@gmail.com> wrote:
> > I think Ulf is correct. You may also have to specify other information as well.
>
> > Here is what I'm doing in the MyEmpire iPhone app to set status. You
> > can see all the data that needs to be set. VBA may differ than ObjC
> > though.
>
> > postData is equal to the string "status=this the the status message text..."
> > length = length of postData string.
>
> > [request setHTTPMethod:@"POST"];
> > [request setValue:@"application/x-www-form-urlencoded"
> > forHTTPHeaderField:@"Content-Type"];
> > [request setValue:length forHTTPHeaderField:@"Content-Length"];
> > [request setHTTPBody:[postData dataUsingEncoding:NSASCIIStringEncoding]];
>
> > On Mon, Jul 4, 2011 at 9:34 PM, Ulf Hedlund <u...@ulfhedlund.se> wrote:
Reply all
Reply to author
Forward
0 new messages