ASP api error

I am getting error when I am trying to add subscriber thought API,  I am getting this error.


An error has occurred while processing your request. An email has been sent to the administrator to resolve this issue. We are sorry if this has caused any inconvenience.


Please help thanks

Mathew Mathew, 8 years ago

Hey Moe,

We'd need a few more details about exactly what you are doing to be able to help you - could you please email support at campaignmonitor.com?


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
moe2008, 8 years ago

I am using ASP API for one of my client who has campaign monitor account. I am using the basic signup form name and email and using provided sample code by campaign monitor. I have used api with php before for several clients all worked fine. This is first time I use ASP api, here is the form and script code below with out my api key and list key


<form action="/include/signup.asp" method="post">
<div id="newsletter_form"><table border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td colspan="2"><strong class="yellow">Subscribe to our E-Newsletter:</strong></td>
    </tr>
  <tr>
    <td>Name:</td>
    <td><input type="text" name="name" /></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input type="text" name="email" /></td>
  </tr>
  <tr>
    <td colspan="2" align="right"><input type="submit" name="Submit" value="Go" /></td>
    </tr>
</table></div>
</form>



dim apikey, listid, name, email, newsletter, postdata, response

apikey = "mylong api charcters here" 'Your api key
listid = digit list id her     'your list id

name = Request.Form("name")
email = Request.Form("email")





If email <> ""  Then

    postdata = "<?xml version=""1.0"" encoding=""utf-8""?>"
    postdata = postdata & "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">"
    postdata = postdata & "<soap:Body>"
    postdata = postdata & "    <Subscriber.Add xmlns=""http://app.campaignmonitor.com/api/"">"
    postdata = postdata & "        <ApiKey>" & apikey & "</ApiKey>"
    postdata = postdata & "        <ListID>" & listid & "</ListID>"
    postdata = postdata & "        <Email>" & email & "</Email>"
    postdata = postdata & "        <Name>" & name & "</Name>"
    postdata = postdata & "    </Subscriber.Add>"
    postdata = postdata & "</soap:Body>"
    postdata = postdata & "</soap:Envelope>"
   
    Dim xmlhttp
    'Set xmlhttp=Server.CreateObject("Microsoft.XMLHTTP")
    'Set xmlhttp=Server.CreateObject("MSXML2.ServerXMLHTTP.4.0")
    Set xmlhttp=Server.CreateObject("MSXML2.ServerXMLHTTP")
   
    xmlhttp.open "POST","http://app.campaignmonitor.com/api/api.asmx" ,false

    xmlhttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
    xmlhttp.setRequestHeader "SOAPAction", """http://app.campaignmonitor.com/api/Subscriber.Add"""

    xmlhttp.send postdata
   
    response = xmlhttp.responseText
   
    Response.Write response


End If




Thank you for your reply so fast

Ken Ken, 8 years ago

Hi Moe,

I've given you a more detailed answer in your support request. In future, if you still receive the "An error has occurred while processing your request. An email has been sent to the administrator to resolve this issue. We are sorry if this has caused any inconvenience." error, this is a good place to get a more meaningful answer.


http://www.campaignmonitor.com
moe2008, 8 years ago

Thank you Ken

moe2008, 8 years ago

Hey guys I still have some problem with the code. After response comes back success I need to redirect to thankyou page which I created. But I get blank page. This asp page is part of .net project. I asked the person who is responsible for the site if SmartNavigation is turned True and he said is not turned on so if you have any idea how I do the redirect other than response.redirect() method in ASP, I appreciated.


Thanks

Moe

Ken Ken, 8 years ago

Can you post the code which does the redirect? Can I see what your trying to do?


http://www.campaignmonitor.com

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098