Username: Password:

Author Topic: Ericson Labs Service  (Read 6868 times)

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Ericson Labs Service
« on: May 31, 2010, 09:29:44 am »
Dear Zydio, I have already made the service for this, and the problem is the username and password (required) in which in this just key is required which does not fit in the size of username!

Is there any help for this ?

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #1 on: May 31, 2010, 10:29:12 am »
The API key is 40 characters long while it seems for the username is 31-21 characters long! How can this be changed !

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Ericson Labs Service
« Reply #2 on: May 31, 2010, 10:59:12 am »
You can use the nick field, which allows longer text.
You also did a couple of mistakes, please see the attachment and try it.

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #3 on: May 31, 2010, 11:05:13 am »
Thanks Zydio, I got the points and the mistakes :) I will check it

Nice info..

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #4 on: May 31, 2010, 11:18:00 am »
It work and delivered, the only problem is this:
In the site it is been told that

Response

Responses are returned in the standard HTTP response format, where the status code of the response describes the outcome of the function call.
Status Code    Description
200 OK    The message has been successfully sent to the recipient When a send request is successfully performed, the amount of actual SMS messages sent are placed in the message payload. Since SMS Send & Receive automatically splits long texts into several SMS messages, this number depends on the length of the text sent.
400 BAD REQUEST    One or more of the required parameters are missing or are badly formatted. Make sure you aren't using characters not included in the default GSM alphabet
401 UNAUTHORIZED    The API key is invalid or no longer authorized for use with the SMS Enabler. This response will be returned when all free messages on a key have been sent
403 FORBIDDEN    The number of maximum daily requests has been reached
503 SERVICE UNAVAILABLE    The SMS enabler is temporarily unavailable; please try again in a short while

But it the script does not find the "200 OK" Shall we omit that part because it will not find that and says not sent! and website error but the sms is sent and delivered
« Last Edit: May 31, 2010, 11:35:13 am by mip104 »

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Ericson Labs Service
« Reply #5 on: May 31, 2010, 11:24:47 am »
Yes the script needs to be improved to handle the error conditions and other info

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #6 on: May 31, 2010, 11:28:15 am »
Yes the script needs to be improved to handle the error conditions and other info

Yes, but for the successful sent I have provided the "200 OK" status for the HTTP respond, but it seems it is not found in the respondHTTP?!

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Ericson Labs Service
« Reply #7 on: May 31, 2010, 11:46:09 am »
Yes the script needs to be improved to handle the error conditions and other info

Yes, but for the successful sent I have provided the "200 OK" status for the HTTP respond, but it seems it is not found in the respondHTTP?!
Oh yes, it may be because the 200 OK is part of the HTTP header and maybe in the respondHTTP there is only the reply body/content.

I don't know python, I can't help you to access response header info, sorry.

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #8 on: May 31, 2010, 12:05:35 pm »
It is OK, I just removed that part, no need to check, it just sends. This service is working now, but If I found additional info on the HTTP header, I will  try to update and improve this script
« Last Edit: May 31, 2010, 12:07:31 pm by mip104 »

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #9 on: May 31, 2010, 12:10:27 pm »
No the header also didn't work. Never mind, as it sends, no need for the error codes ;)

There is good info on the handlers in here:
http://www.voidspace.org.uk/python/articles/urllib2.shtml
« Last Edit: May 31, 2010, 12:29:51 pm by mip104 »

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Ericson Labs Service
« Reply #10 on: May 31, 2010, 12:54:03 pm »
No the header also didn't work. Never mind, as it sends, no need for the error codes ;)

You should add checks, because if you don't do it you can never be sure the message has been sent (the server can have a temporary problem, your account can be blocked, you can finish the messages..)

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #11 on: May 31, 2010, 01:55:20 pm »
For sure I will, but for now I just ignore it to see how can I work with the Error Handlers

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #12 on: June 01, 2010, 09:20:43 am »
Does code 200 in your opinion regarded as URLerror code?

Zydio

  • Administrator
  • Hero Member
  • *****
  • Posts: 2111
  • goText++ Desk! author
    • View Profile
    • goText++ Desk! homepage
Re: Ericson Labs Service
« Reply #13 on: June 01, 2010, 11:04:00 am »
Does code 200 in your opinion regarded as URLerror code?

200 stands for OK.
Maybe "URLerror" contains all other http return codes, at least those of the 4xx family (= error codes).

Mip104

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 699
    • View Profile
Re: Ericson Labs Service
« Reply #14 on: June 01, 2010, 11:54:20 am »
Thanks, Sorry for asking so much!
Is there any way to test the codes without any SMS being sent ?

I thought of one, which I can test it with wrong API key! so I can get the unauthorized Error code!? is it right ?