I have two serious issues that I need help with. And these are two issues that I can recreate without problem. The first is that I have logins that I can login with interactively that will fail with the api. These logins fail with a 500. I also have logins that work flawlessly with the same code with the api. So why do some logins work and some don't? (I'm doing a post to start the process to pull down custom fields when this happens.) The second issue is that I'm doing a get to check the status of the prior post request (when it goes through) and it will often fail with a 401 even though I've just succeeded with the exact same credentials six seconds earlier. And then in six seconds it will then login without an error. So why the intermittent login failures?
These are really big issues for us.
Thanks for any help,
What language and platform are you programming on? Also, can you post your code? Does this also happen on other testing platforms such as the REST Client? If you can replicate this in the REST Client, please let us know the Username you can replicate this on (you can send this in to our webservices support team).
Code is c#. I have a web service that takes a request to "update a clients custom fields" From there the request is sent to a windows service that kicks off a thread that makes several calls. The first call is a post of the following:
StringBuilder data = new StringBuilder(); (passedinusername is the username, apikey & unifyer are added in below)
From this I get the url to check to see if the status is pending or complete. I check this status via a get every six seconds. If it's complete I then use a get to pull it down and parse it, etc.
There are two problems. The first is that I have logins that work fine as far as logging into the CC web site. However, when I try to use them this way I get an immediate 500 on the post. (Since these are all "test accounts" is there some type of check? I have new test accounts and old test accounts, some of which are past the "test period". Would this matter?) But I also have several accounts that work perfect. So I don't believe it's a code issue but rather how the backend is responding to the different logins.
The second problem is that in my service that checks every six seconds, I often get a "good response", "good response", "401", "good response", 401, etc. Since I trap the 401 I eventually get a status of Complete even if I've gotten several 401's along the way. The problem though is why am I getting 401's at all? It concerns met GREATLY that I am getting these intermittent failures.
As far as using a rest client, I usually have better luck. (btw, I don't use the one you recomend because I don't want the Java overhead. Using either Fiddler or the FF addon called RESTCLIENT are MUCH better tools for testing this stuff.) I don't normally get 401's when I use a rest client, however if I hit it several times in a row I can generate a 401 and sometimes a 500 as well.
As far as using a rest client and the post from above, I have certain logins that immediately return a 500 even though I can login interactively.
I do wonder if the post from above is the best way to pull these fields. ie, pulling from list 1 vs pulling from do not mail, etc.
On a side note if you just gave me a function getCustomFields(string userName, user, credentials.....) if it would make my life MUCH simpler.
That's some great information. Is it possible for you to send some of the usernames that cause intermitent failures and some that succeed all the time to me? I'd like to run some tests on our side via C# as well and see if I can replicate. If it's occuring using the same code, that does indicate some sort of an issue on our end.
Couple more clarification questions, are you using Digest or Basic authentication? Does the 401/500 issue also occur on other collections than the Bulk Activities? If so, what other Collections?
Regarding the getCustomFields question, the easiest way I can think of to do this is currently a two step process:
This will return to you a full XML doc on the contact you searched for which will include the Custom Fields. You can then update this information (XMLDocument and XMLNode classes can be used to make this very easy) and PUT back the information to the same URL. This is instant as well so you will get a 201 Success or 409 Conflict immediately. There will be no need to check periodically to see if is successful as you do with the Bulk Activities collection. This should cut down alot of your processing time and alot of your API call overhead.
If you have any questions on how to parse the XML Document in C#, here is a great post on how to set up the Schema in C# so that the language does all the work for you.
I was just talking to one of our engineers regarding what you are looking to actually do with the Custom Fields. I apologize for the confusion, the method you're using is actually the only way to currently get the information you are looking for (being the modified names for Custom Fields 1-15). This is being looked at by our developers, though I can't give any ETAs on when they will look into this feature request.
Dave, Unfortunately I was already aware that the methods you outlined in your earlier post about the custom field names wasn't going to work. I REALLY, REALLY, REALLY would love a way to pull down the renamed custom field names without having to do it the way I'm doing it. (It's a LOT of work on my end for something incredibly simple. But it's a BIG issue for us...)
I'll send to the webservices email account some username / passwords for you guys to try.
I got your email and I responded with some follow up. I do want to let you know we have a feature request in regarding the Custom Fields. We are looking into this going forward, though I can't provide an exact time frame. Once we do release an easier way to accomplish what you are looking for, we will post this in the forums and you should also receive an email regarding the changes.