A feed should be enabled in the settings. Under Settings > Company add a new section called "Data Feeds" using the FontAwesome icon "fas fa-rss fa-fw"
There should be 1 links under Feeds, "Feed Settings". On this page, we should have a checkbox to enable or disable each feed, and an example of the code required to embed the feed that a user can copy/paste into their website.
I think we should default to no permissions for the feed, and if a feed is called we would return a message that says "This data feed is disabled, to enable visit Settings > Company > Feeds in the staff area."
We would actually return this from the URL called though, so that with the embed code it is actually output to the browser:
document.write('This data feed is disabled, to enable visit Settings > Company > Feeds in the staff area.');
This doesn't matter so much, but it would be ideal if feeds started with /feed/ in the URI, and good if this route can be changed if desired. So a feed URL would look something like
- Package Name
- Package Description
- Package Pricing
- Domain Pricing (HTML table including all configured TLDs and their new, renew, transfer prices)
Example URLs for each with possible parameters
Get the name of Package ID 1, in English
Get the description of Package ID 1, in English, return HTML version
Get the price of Pricing ID 1. Price is the normal price, Renewal Price, Transfer Price, Setup Fee, and Cancellation Fee should also be options, as well as currency, term, and period
This one would require a little more work and be output in a table form that could be styled. I don't think we would necessarily have to use the domain manager, but it's possible that the domain manager would need to implement this feed. Requires more details.
Calling these URLs should return the value inside document.write(); and would be embedded into an HTML page like so: