Title: Dynamic XML source from API?
Last modified: May 14, 2023

---

# Dynamic XML source from API?

 *  Resolved [vipasane](https://wordpress.org/support/users/vipasane/)
 * (@vipasane)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/)
 * **Question:How can I use a dynamic source which is XML formatted? But does not
   have .xml ending.
   Static XML file from URI this process showed in a [tutorial](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-xml/)
   was a breeze. Errors:WPDataTables: Create a Table: Create table: Create a data
   table linked to an existing data source. (one with XML option)Another when form
   validation fails in with full URI And with short URI: ([https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert](https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert))“
   There was an error while trying to save the table! error There has been a critical
   error on this website.”
 * ![](https://ibb.co/ky0KBQt)
 * ![](https://ibb.co/YTVKhBz)
 * 
   **Background:I have an API which lists job adds and those would need to be added
   to WP site. API and production content available here:[https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert&state=-1&loginuser=guest&loginpass=vieras](https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert&state=-1&loginuser=guest&loginpass=vieras)
   Justification:And for sure I can provide jquery datatables ajax url to fetch 
   content on client side just by providing URL.But I would need to make this functionality
   more usable for those who are creating content and layout (=not technical or 
   coder friendly)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [vipasane](https://wordpress.org/support/users/vipasane/)
 * (@vipasane)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/#post-16736600)
 * For some reason image blocks with following links were not showing up.
   Screenshots:
   [https://ibb.co/YTVKhBz](https://ibb.co/YTVKhBz)[https://ibb.co/ky0KBQt](https://ibb.co/ky0KBQt)
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/#post-16741997)
 * Hello.
   1. In regards to using your initial link from the short URI you shared
   with us,
 * if we try to follow the URL from our browsers, it says you have some syntax error
   in that file. Here is a screenshot what happens if we try to load your URL in
   a browser :
 * ([https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert](https://promesta.likeit.fi/servlet/XML?handler=duuni.Advert))
 * ![](https://i0.wp.com/ticksy_attachments.s3.amazonaws.com/8429702701.png?ssl=
   1)
 * So it seems that you have some error in that path, or the XML format itself,
   
   but our support does not cover finding errors from your source file or URL path.–
   And also you asked if it is possible to link a dataTable from XML, when the path
   URL to the source file does not end with an .XML extension,sorry to disappoint
   you, but that is not possible,the file needs to be accessible online, and the
   path has to end with the XML extention.Also for XML format, please check the 
   format that is [explained here](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-xml/).
   If i understood, you were able to make a table on your WordPress linked from 
   our sample XML data set available from [this link](http://wpdatatables.com/sample_files/cars_dummy_db.xml),
   then this means that the issue is coming either from the format of your file,
   or the server.Our support does not cover finding the exact error in your file/
   or on the server configuration.
 * 
   2. In regards of providing data source from an API for our dataTables,it is 
   not possible to have it in form of XML.If you wish to use API, and to pull data
   from it,  then you will have to adapt it to PHP Array, and make a [table linked to PHP Array.](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-serialized-php-array/)
 * Alternatively, if you convert this data to JSON,
   If you link the table to a JSON
   file, this file has to have structure as we pointed out on [this documentation](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-json-input/).
   I will copy the important part here :
 *  Currently, wpDataTables accepts this, and only this format of JSON (see example
   on the docs page): 
 * **a one-level array of same-structured objects where each object will be parsed
   as a row, and each field inside of the object as a cell.**
 * –
 *  If your software does not return this format, you would need to prepare, for
   example, some PHP adapter to return one of the formats that wpDataTables would
   accept.
 * –
 * 2. If your JSON file has multiple levels, then you will have to try [our NESTED JSON method](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wordpress-tables-from-nested-json-data-with-json-authentication/).
 * Kind regards.
 *  Thread Starter [vipasane](https://wordpress.org/support/users/vipasane/)
 * (@vipasane)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/#post-16742924)
 * Thank you for your quick and detailed response. Yes there are occasional errors
   in api while one is using short uri. Can I fake URL by providing a get parameter
   which ends xml since I really can’t make any changes to a 3rd party API?
 * Any tutorial or idea of a plugin which could sync xml file separately and to 
   be hosted in the very same wp instance? I would really like to keep this “code
   free” aka content creator friendly.
 * Found this [one](https://wpgetapi.com/docs/using-with-wpdatatables/) but that
   requires paid version and adds complexity. starting to think that vanilla JS 
   datatables with Ajax call + html is as good. Too bad these solutions are taking
   control off from content creators and they are still dependant on coders.
    -  This reply was modified 2 years, 11 months ago by [vipasane](https://wordpress.org/support/users/vipasane/).
 *  Plugin Author [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * (@wpdatatables)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/#post-16748221)
 * Hello.
   In regards to errors in API from the data source,i am sorry but we are
   not able to advise anything about that.–The same goes for your question, you 
   wrote : “**_Can I fake URL by providing a get parameter which ends xml since 
   I really can’t make any changes to a 3rd party API?_**“Our support does not cover
   workarounds on issues with API data sources.We can only advise you on issues 
   coming from our plugin.–In regards to a tutorial or idea of a plugin which could
   sync xml file separately and to be hosted in the very same wp instance,I’m afraid
   we are not able to advise you on that,we do not have experience with something
   like this.–In regards to the [tutorial ](https://wpgetapi.com/docs/using-with-wpdatatables/)
   you found from the WPGetAPI,we are not able to comment about their product.We
   see that in that tutorial they used our Lite/free version, as you can use the“
   Serialised PHP Array” in our Lite Version.If you meant to say that you need **
   their premium product** in order to achieve that use-case, we are sorry but we
   are not able to comment on that,since it is not our product.You can ask their
   support if they have any workaround that does not need their premium version.–
 * If you link the table to a JSON file, this file has to have structure as we pointed
   out on [this documentation](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-json-input/).
   I will copy the important part here :
 * Currently, wpDataTables accepts this, and only this format of JSON (see example
   on the docs page):
 * a one-level array of same-structured objects where each object will be parsed
   as a row, and each field inside of the object as a cell.
 * –
 * If your software does not return this format, you would need to prepare, for 
   example, some PHP adapter to return one of the formats that wpDataTables would
   accept.
 * –
    2. If your JSON file has multiple levels, then you will have to try our [NESTED JSON method](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wordpress-tables-from-nested-json-data-with-json-authentication/).
    3. If you wish to use API, and to pull data from it, then you will have to adapt
       it to PHP Array, and make a [table linked to PHP Array.](https://wpdatatables.com/documentation/creating-wpdatatables/creating-wpdatatables-from-serialized-php-array/)
 * That is everything we can advise when it comes to connecting a data source from
   API with our plugin’s current capabilities.
 * If you have an idea how we can improve this with a new option/ or improvement,
   
   please feel free to search [on our suggestions page](https://wpdatatables.com/documentation/feature-suggestion),
 *  to see if someone may be already suggested this feature. If you can’t see it,
   feel free to add your suggestion there,  and as more people vote, the feature
   will move higher on the priority list.
 * You can certainly follow our [changeLog page](https://wpdatatables.com/help/whats-new-changelog/)
   if you’d like ( it is also available in the plugin dashboard), where we state
   any changes/new features/bug fixes during updates;
 * and [our newsletter](https://wpdatatables.com/newsletter/)[,](https://wpamelia.com/subscribe-newsletter/)
   so you’re informed about new features, bug fixes, freebies, etc.
 * ​
   Kind regards.
    -  This reply was modified 2 years, 11 months ago by [wpDataTables](https://wordpress.org/support/users/wpdatatables/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Dynamic XML source from API?’ is closed to new replies.

 * ![](https://ps.w.org/wpdatatables/assets/icon-128x128.gif?rev=3010404)
 * [wpDataTables - WordPress Data Table, Dynamic Tables & Table Charts Plugin](https://wordpress.org/plugins/wpdatatables/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdatatables/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdatatables/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdatatables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdatatables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdatatables/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [wpDataTables](https://wordpress.org/support/users/wpdatatables/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/dynamic-xml-source-from-api/#post-16748221)
 * Status: resolved