Are you sure you want to close the chat?Chat will be closed and the chat history will be cleared.
continue to sign out,
or stay on chat.
To review this chat session please click this windows.
Chat Online
Chat Online0
Support

Forum

A place for Dynadot and community experts alike to ask questions, share ideas, and more.
API questions from a programmer
2/11/2011 18:50
I have read over the API2 api documentation, looks very clean, thank-you for that.

What I would like to do here is quickly write 2 implementations, 1 in perl and 1 in php. First question
is what is best way you guys figure in parsing values, my idea is from this example from API page:

Search Example
Request

https://api.dynadot.com/api2.html?key=8S7I2s6Qd8g&
command=search&domain0=mydomain.com&domain1=mydomain.netResponse

ok,

domain0,mydomain.com,,no,
domain1,mydomain.net,,yes,

What will happen is we will get all this back into one variable either through LWP using perl , or socket function in php, so i am wondering if people are using split/explode on the "comma" character? Be nice to have a end of line delimiter here, seems best option I can think of is erase white space, split on comma into an array, and pop first element off in this case.

Second question is more along lines of functionality, seems to be steps are search, check if available, if so, issue register command on it, if success, set nameservers on it. For testing, use delete command after one hour of registering. SO my question is , once the one year is up, auto renew defaults to off, no email is sent when renew is off, so we are magically all suppose to set cron jobs when domain was registered to call the renew function after 11 and half months or so? Seems like a real pain.

I think what would be nice is if we could globally set domains to renew and if we get nonpayment from a client our script would issue a non-renew request to api, there is currently nothing in api to toggle the auto-renew switch and I think it would be key in effectively integrating it with say a paypal script automatically that would fire off a request for no-renew on cancelled subscriptions or payments.

Last question is i read over forum about not allowing multiple API calls simultaneously, what I am thinking if that is the case the best scenario is building a single process queueing system and only sends 1 request at a time and keeps anythign else in a queue, perhaps overkill, but seems needed in case there are any race conditions?
Reply Quote
2/18/2011 15:08
Hello,

We currently do not have this feature for the auto renew. Once the domain is renewed, we can't really undo it without deleting the domain itself.

As for your last question,  you need to wait for the api server to respond to your request before you can send another one.  Yes, you should have a queue of requests, but you can only send one out after getting a response back from the previous request.

Please let us know if you have any additional questions.

Best Regards,

Dynadot Staff
Reply Quote
2/25/2011 06:54
All is good, I programmed a fully functional perl module to utilize the search, set nameservers, register and delete api calls.

One issue I did run into when programming this was around
3pm searching multiple domains would occasionally draw an error, so i took the domains that did that, gave only ones that got an error a "second chance" and that seemed to mitigate it enough to return successful searches.

For queueing system, I just used a lockfile so any other processes would block before being allowed to use api till another one was done first, good enough for my purposes.

All in all code seems perfected now, an autorenew toggle command would definately still be useful!
Reply Quote