Forums

mikerowehl

mikerowehl

Newbie
Always getting error code 4 back
I'm trying to use the APIs to test out sending SMS to myself. I tried sending requests using a developer key, and if I understand the reference docs correctly a URL like the following should work:

http://www.vodafonebetavine.net/api/send/...
...sms.xml?auid=DEVAUID&message=miketesting...
&dest=+16507146444

But I always get an error code 4 from that. I also tried generating a Mashup key and using that instead of my developer key, but same thing. Can the APIs only be used to send to Vodafone users? Or am I doing something else wrong?

- Miker
Login to reply
OwenGriffin

OwenGriffin

Connoisseur

Betavine Team

RE: Always getting error code 4 back as a reply to mikerowehl
mikerowehl:
I'm trying to use the APIs to test out sending SMS to myself. I tried sending requests using a developer key, and if I understand the reference docs correctly a URL like the following should work:

http://www.vodafonebetavine.net/api/send/...
sms.xml?auid=DEVAUID&message=miketesting...
&dest=+16507146444

But I always get an error code 4 from that. I also tried generating a Mashup key and using that instead of my developer key, but same thing.


Your developer key will not send messages. It is designed only for testing purposes. The developer key will behave exactly like a mashup key. The mashup key however will send messages.

A error code 4 is an invalid parameter. I noticed from the URL you have posted you have a prefixed a + at the beginning of the number. Try again without the +.

mikerowehl:
Can the APIs only be used to send to Vodafone users?


The API should send text messages to any operator.
Login to reply
mikerowehl

mikerowehl

Newbie
RE: Always getting error code 4 back as a reply to OwenGriffin
It was actually a typo in the url, I had auid instead of uaid, swapping to JSON encoding made the error return more obvious. It says it's delivering messages when I use my mashup key now, and it's subtracting credits from my account. But I'm not actually getting the messages. Anyone tried using the API to deliver messages to ATT/Cingular in the US?

- Mike
Login to reply
OwenGriffin

OwenGriffin

Connoisseur

Betavine Team

RE: Always getting error code 4 back as a reply to mikerowehl
mikerowehl:
It was actually a typo in the url, I had auid instead of uaid, swapping to JSON encoding made the error return more obvious. It says it's delivering messages when I use my mashup key now, and it's subtracting credits from my account. But I'm not actually getting the messages.


If this turns out to be a connectivity problem on our side I'm sure we can just top up your credits.

mikerowehl:
Anyone tried using the API to deliver messages to ATT/Cingular in the US?


I have not tested it. We don't have access to an ATT/Cingular SIM. I will investigate to see if any of your messages are failing.
Login to reply
OwenGriffin

OwenGriffin

Connoisseur

Betavine Team

RE: Always getting error code 4 back as a reply to OwenGriffin
Would you be able to provide a date and time when you last sent a message to an ATT/Cingular SIM so I can look at the logs more closely?

Thanks.
Login to reply
mikerowehl

mikerowehl

Newbie
RE: Always getting error code 4 back as a reply to OwenGriffin
Hey Owen, thanks for the offer, here are the details for a message I sent at 12:30pm Pacific time. This is the command I used to generate the request:

curl 'http://www.vodafonebetavine.net/api/send/sms.xml?uaid=2m8xlc51c6p3zkbyxggdivvel5fqu2qv&message=miketesting&dest=16507146444'

and here is the response, it has a transaction id and all, hopefully it'll make it easy to dig out:

<?xml version="1.0" encoding="UTF-8"?>
<response version="1.1">
<method>send/sms</method>
<status>OK</status>
<transaction>
<id>5793</id><messages>
<message><id>5624</id><status>1</status>
<deliveredAt></deliveredAt><sentAt>2008-02-27 20:31:07.0</sentAt></message>
</messages></transaction>
</response>
Login to reply
mikerowehl

mikerowehl

Newbie
RE: Always getting error code 4 back as a reply to mikerowehl
Anyone have any ideas here? I tested it out again to see if it was a transient problem, but still the same thing. The message is reported as delivered, a credit is deducted, but no message makes it through to my phone.
Login to reply
mikerowehl

mikerowehl

Newbie
RE: Always getting error code 4 back as a reply to mikerowehl
Still not getting messages through. Anyone?
Login to reply
OwenGriffin

OwenGriffin

Connoisseur

Betavine Team

RE: Always getting error code 4 back as a reply to mikerowehl
mikerowehl:
Still not getting messages through. Anyone?


I've contacted the guys who run the SMS gateway and they are looking into it.

The Betavine API appears to be sending the messages successfully.

Sorry for the delay.
Login to reply
mikerowehl

mikerowehl

Newbie
RE: Always getting error code 4 back as a reply to OwenGriffin
Thanks Owen! I'll keep checking back.
Login to reply
Select page:     1   2   >   »

Recent forum posts

Re: Send SMS with encoded contro...

Hook,


OwenGriffin:
Unfortunately you can't send binary messages using the Betavine API.

Sending text messages is restricted to ASCII characters.

Sorry,

Owen.

Hi,

I am not quite sure if this is the perfect post to have this question answered, but I am trying to develop a mobile widget that needs to access to the mobile handset location (if available on the handset). Does anyone knows how to do this?


Many thanks
Higino

more...

Re: Send SMS with encoded contro...

OwenGriffin,


Unfortunately you can't send binary messages using the Betavine API.

Sending text messages is restricted to ASCII characters.

Sorry,

Owen.

more...

Send SMS with encoded control ch...

KSL,


Hello,

We try to send sms with some control characters(ASCII characters < 32). Included as normal text, the request fails with an 403 error from the server. So we tried to encode the control characters in the form %xy where x and y are the hexadecimal representation of the byte. Like it's done in Java and C# when encoding an url (we are using C#). The content type for the http request is set to application/x-www-form-urlencoded. But still we get that 403 error.

Is there a possibility to send sms with included control characters or is it possible to send binary data with the api?

Karsten

more...

RE: API & PHP

OwenGriffin,


You actually need to set the user agent to be something. The error is occurring because you don't have one.

more...

RE: API & PHP

tatude,


Ok, so I understood that something like this should be added:
curl_setopt($request, CURLOPT_HTTPHEADER, array('User-Agent: ""'));

...however, I'm still getting the same "302: document has moved here" message.

Could anyone provide a simple example of sending a "Hello world" SMS, etc. -- with/without CURL? I'd like to get it working in some way. Thanks!

more...

RE: API & PHP

OwenGriffin,


Ok. So you'll need to set a 'User-Agent' header for your CURL requests. So use the setopt function.

more...

RE: API & PHP

tatude,


Sure, if you can make something out of it. I'm using it with a cURL lib (curl.php), so it's not all in one place.

Anyway, here's the code with the URL:
<?php
include_once('curl.php');

$cURL = new cURL();

$URI = "http://www.betavine.net/api/send/sms?uaid=MY_KEY&dest=MY_NUMBER&message=Hello";

$smsresult = $cURL->get($URI);

// Print return code
echo "<pre>";
print_r($smsresult);
echo "</pre>";
?>


These options are set for cURL elsewhere:
CURLOPT_HEADER => 0,
CURLOPT_RETURNTRANSFER => TRUE


--Tatu

more...

RE: API & PHP

OwenGriffin,


Can you post your code which you use to call the API here?

more...