Welcome to the Ifbyphone Developers zone. This forum provides a place for the community of advanced Ifbyphone users and developers to share ideas, exchange code, and ask questions.  

Additional Resources

Ifbyphone Company Blog - Ifbyphone Twitter Page - Ifbyphone Company Web Site - Ifbyphone Partners Page
Ifbyphone's CEO's (Irv Shapiro's) Personal Blog - Irv Shapiro Twitter Page

It has been brought to our attention that the NEW MEMBER link does not always display in IE7. If you do not see the new member link in the login box on the right, please try another browser. (Firefox works fine.) In addition please note that Phonemashup accounts are completely separate from Ifbyphone accounts.

If you need help fast, call 877 295 5100 to reach the Ifbyphone "Success Team".   (Support is option 2.)

Members Login
Username 
 
Password 
    Remember Me  
Chatbox
Please log in to join the chat!
Post Info TOPIC: How to handle errors


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
How to handle errors
  
 


Hi,str =

"https://secure.ifbyphone.com/click_to_xyz.php?app=cts&acct=XXX&scheduleonly&survo_id=ccc&key=dfgdg&type=2&sdate=" & StartDate & "&edate=" & EndDate & "&tz=Pacific&phone=" & csvfile & "&attempts=3&desc=Mydfgdfg" 

 

Dim hRequest As HttpWebRequest = WebRequest.Create(str)

 

Try

 

Dim resp As HttpWebResponse = hRequest.GetResponse() 

Dim sr AsNew StreamReader(resp.GetResponseStream()) 

Dim results AsString = sr.ReadToEnd()sr.Close()lblCallStatus.Visible =

True

lblCallStatus.Text = results

 

Catch ex As WebExceptionResponse.Write(

"<font color=red>Error<br />Status: " & ex.Status & "Message: " & ex.Message & "</font>") 

EndTry

in the above code i want to handle if there is any error dure csv file does not have write format or any erros records not found in .csv file etcc.
How to handle this.



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
  
 

We will pass back one of the following depending on the situation:

- Specified Broadcast CSV file extension must only be "csv"
- Invalid Broadcast phone number(s) specified
- Specified Broadcast CSV file is improperly formatted:  missing 'number' column


__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
  
 

Thanks for your reply.
1. IF .csv file has 5 numbers to schedule, out of 5 numbers 2 numbers are incorrot format. How to handle this.
2. What message do you return if there are no errors returned.
3. Also is it good idea to check only sucess message and in else part handle logic for error prcoessing. do you reccomond this.
ex:
   if  check "results" variable for sucess
      else
           // logic for handling errors etcc








__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
  
 

1) We will automatically scrub out most bad numbers from your CSV file. You will not receive any immediate response when numbers are scrubbed. We simply will not attempt to call that user.

2) We return back "X Voice Broadcast(s) scheduled. Broadcast ID: XX" Where X is the number of calls we will be calling and XX is the broadcast ID associated with the broadcast.

3) Yes I would recommend to check for the success message. If you dont receive the success message, assume the broadcast has not been scheduled.

__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
  
 

"1) We will automatically scrub out most bad numbers from your CSV file. You will not receive any immediate response when numbers are scrubbed. We simply will not attempt to call that user."

in .csv file, 2 out of 5 numbers are not in correct format.
as per my understanding from you reply above case(2 out of 5 numbers are not in correct format), i still receive sucess message saying "5 Voice Broadcast(s) scheduled. Broadcast ID: XX".

actaully, 3 broadcasts only schduled right. Do you log anywhere 2 incrrect format numbers. Please help, 



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
  
 

Currently there is no log you can access by the API to give you the incorrect format numbers. We will show you in the broadcast report which calls did go through however.

__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
  
 

Thanks a lot for the help!.
 One last question, How to check the sucess message as  success message is "X Voice Broadcast(s) scheduled. Broadcast ID: XX". here "X, XX" will change evry time.
if i want to compare ,

if result = '"X Voice Broadcast(s) scheduled. Broadcast ID: XX". " like this.
{
  // sucess logic
}

how can i make above condition equal. so that control goes to success logic.
Please help.



__________________


Veteran Member

Status: Offline
Posts: 45
Date: Jul 14, 2009
  
 

I am not sure I understand your question. If you are checking if any error, then you can check if string contains 'Voice Broadcast(s) scheduled' . If you see that, then there was no error in scheduling the broadcast.

Hope this helps


__________________
-Phil Seguin
pseguin@ifbyphone.com


Member

Status: Offline
Posts: 20
Date: Jul 14, 2009
  
 

Thanks a lot. i got it. Just i wanted to check if any errors.


__________________
Page 1 of 1  sorted by
 
Quick Reply

Please log in to post quick replies.

Post to Facebook Post to Digg Post to Del.icio.us

This is an open and public forum so Ifbyphone is unable to ensure that all code and suggestions posted to this forum are correct. Please use all code posted here at your own risk. Ifbyphone assumes no liability for code, recommendations and suggestions posted to this forum.

Users and developers will find hundreds of useful posts at the Ifbyphone company blog.