cancel
Showing results for 
Search instead for 
Did you mean: 

Edit Subscriber problems

Highlighted
Occasional Participant

Edit Subscriber problems

I am using the php class from this site and everything was working well until the end of last week.


Code that had been working for at least a month, stopped working.


This only happens when I try to edit a subscriber via the editSubscriber function.  The code line $emessage = curl_exec($ch);  just hangs now.


As I said the same code worked last week?? It also does not work with the example class provided edit_contact.php.


I can upload a new contact via the addSubscriber - just editing is a problem.


Does anyone have any clue what is going on?


Any help would be greatly appreciated.


 


Leora

17 REPLIES 17
Highlighted
Occasional Participant

edit subscriber problems

One more thing: I am  using the REST Client to test and I am getting back error 409. I am just trying to change the first name from a user that exists.


Here is my xml:


 


<entry xmlns="http://www.w3.org/2005/Atom"><title>TitleNode</title><updated>2010-01-18T14:48:32+01:00</updated><author><name>CTCT Samples</name></author><id>https://api.constantcontact.com/ws/customers/nameofaccount/contacts/3651</id><summary type="text">Customer document</summary><content type="application/vnd.ctct+xml"><Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document<EmailAddress>test2@test.com</EmailAddress><FirstName>Leora2</FirstName><LastName>Waldman</LastName><MiddleName></MiddleName><CompanyName></CompanyName><JobTitle></JobTitle><OptInSource>ACTION_BY_CUSTOMER</OptInSource><HomePhone>999-6971</HomePhone><WorkPhone></WorkPhone><Addr1>Nachal uriah 12/9</Addr1><Addr2></Addr2><Addr3></Addr3><City>BS</City><StateCode></StateCode><StateName></StateName><CountryCode></CountryCode><PostalCode>90009</PostalCode><SubPostalCode></SubPostalCode><Note></Note><EmailType>HTML</EmailType><CustomField1></CustomField1><CustomField2></CustomField2><CustomField3></CustomField3><CustomField4></CustomField4><CustomField5></CustomField5><CustomField6></CustomField6><CustomField7></CustomField7><CustomField8></CustomField8><CustomField9></CustomField9><CustomField10></CustomField10><CustomField11></CustomField11><CustomField12></CustomField12><CustomField13></CustomField13><CustomField14></CustomField14><CustomField15></CustomField15><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/nameofaccount/lists/40"/></ContactLists></Contact></content></entry>

 

 

What am I doing wrong??

 

Thanks,

Leora
Highlighted
CTCT Employee

Hi Leora,   There have been

Hi Leora,


 


There have been no changes on our end that would affect the sample forms. I have just tested all of the functionality of the sample forms and all have functioned properly.


 


If you would like to post your source code or provide any debug messages or errors it would be very helpful in trying to see what may be causing your issue.


 


In response to your second issue, a 409 error is a conflict that is most likely a result of trying to create a contact with an email address that is already in your account. You had mentioned that you are trying to update the contact and the XML looks correct however I believe that you are trying to POST to the contacts collection with that information when you should be doing a PUT to a specific contact. If you need more clarification please provide me with the request URI and the method that you are using so that I can verify why you are getting that error.

Dan H

Support Engineer, Constant Contact

Highlighted
Occasional Participant

reply to updating contact

Thanks for your help,


For now I am just trying to get the code to work for the example (& as I said it was working before). And I am not trying to create a new contact just edit and existing one using the edit contact code.


I just go to edit_contact_step1.php and enter in the email address, then I get all the details correct and then I change one detail and click edit (on the edit_contact.php) and it hangs. I have traced the problem to the line: !$ccOBJ->editSubscriber($_POST,$contactXML) and further to the line inside that function $emessage = curl_exec($ch);


The {POST} or URI is: http://api.constantcontact.com/ws/customers/accoutname/contacts/3637


and the contactXML is


<entry xmlns="http://www.w3.org/2005/Atom"><title>TitleNode</title><updated>2010-01-19T15:13:53+01:00</updated><author><name>CTCT Samples</name></author><id>http://api.constantcontact.com/ws/customers/accountname/contacts/3637</id><summary type="text">Customer document</summary><content type="application/vnd.ctct+xml"><Contact xmlns="http://ws.constantcontact.com/ns/1.0/">Customer document<EmailAddress>leora@test.com</EmailAddress><FirstName>Leora2</FirstName><LastName>Waldman</LastName><MiddleName></MiddleName><CompanyName></CompanyName><JobTitle></JobTitle><OptInSource>ACTION_BY_CUSTOMER</OptInSource><HomePhone>9996971</HomePhone><WorkPhone></WorkPhone><Addr1>Nachal Uriah 12/9</Addr1><Addr2></Addr2><Addr3></Addr3><City>BS</City><StateCode></StateCode><StateName>NA</StateName><CountryCode></CountryCode><PostalCode>9009</PostalCode><SubPostalCode></SubPostalCode><Note></Note><EmailType>HTML</EmailType><CustomField1></CustomField1><CustomField2></CustomField2><CustomField3></CustomField3><CustomField4></CustomField4><CustomField5></CustomField5><CustomField6></CustomField6><CustomField7></CustomField7><CustomField8></CustomField8><CustomField9></CustomField9><CustomField10></CustomField10><CustomField11></CustomField11><CustomField12></CustomField12><CustomField13></CustomField13><CustomField14></CustomField14><CustomField15></CustomField15><ContactLists><ContactList id="http://api.constantcontact.com/ws/customers/accountname/lists/21"/><ContactList id="http://api.constantcontact.com/ws/customers/accountname/lists/40"/></ContactLists></Contact></content></entry>

 

 

When I use the RESTclient and enter the URl above I get error 401 and then I change the URI to https I get error 401 (yesterday I was getting 409)

In the sample code it uses http and not https?? I am not sure what is going on??

 

Help!

Thanks,

Leora

 

 
Highlighted
CTCT Employee

Depending on the version of

Depending on the version of the sample that you are using there should be a line of code in the doServerCall function that automatically converts URIs that have 'http://' to 'https://'. If you can verify that the information is in fact being PUT to an http:// URI then that would explain a 401 error. Simply checking the value of the $post variable does not mean that the request is going to that exact URI.


 


I ran your XML through the REST Client and after only changing the list ids to match ones in my account, I was able to update a contact successfully.If you are receiving a 401 error in the rest client please make sure that your username, password, and API Key are correct in your request.


 


I would really like to solve this issue for you but I will need to actually see and run the code on my end. Please email a zipped copy of your source code (the entire php sample) to this Web services email and I will troubleshoot this as soon as possible.

Dan H

Support Engineer, Constant Contact

Highlighted
Occasional Participant

what is the web services email

Thanks so much,


 


What is the web services email? When I click on the link - the page does not exist.


 


Thanks,


 


Leora

Highlighted
CTCT Employee

My apologies but I inserted

My apologies but I inserted the link incorrectly. We have to use a javascript link to avoid spam bots so I cant actually spell out the address. It should work now.

Dan H

Support Engineer, Constant Contact

Highlighted
Occasional Participant

I sent the files

Hi Dan,


I sent the files, but I got an email back saying" Please note that we will not be responding to your request for

assistance. As a Web.com customer, they will provide you with all your

Constant Contact support needs. Please resubmit your request for

assistance to support@web.com."

 


Let me know if you don't get them.


 


Thanks,


Leora

Highlighted
Moderator

Thank you for reporting that

Thank you for reporting that Leora, we have our operations team looking into this immediately.  We will let you know when it's resolved and you can get the email to us.  Sorry for this delay!

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

I have not heard back yet..

Did you get your email sorted out?


If so, I will resend the files.


 


Thanks,


Leora