I am encountering an error using the API

+6 votes
220 views

I have written a python module to use the WikiTree API. Retrieving results in JSON format works well, but fails for XML format. The following URL will illustrate the problem (This link opens on a new tab or window.) It does not require an api login.

https://apps.wikitree.com/api.php?action=getPerson&key=8479157&format=xmlfm

I get the following error message:

<?xml version="1.0" encoding="utf-8"?>
<api>
  <error code="internal_api_error" info="Exception Caught: Internal error in ApiFormatXml::recXmlPrint: (api, ...) has integer keys without _element value. Use ApiResult::setIndexedTagName().">

#0 /home/wikitree/www/includes/api/ApiBase.php(508): wfDebugDieBacktrace('Internal error ...')
#1 /home/wikitree/www/includes/api/ApiFormatXml.php(110): ApiBase::dieDebug('ApiFormatXml::r...', '(api, ...) has ...')
#2 /home/wikitree/www/includes/api/ApiFormatXml.php(56): ApiFormatXml-&gt;recXmlPrint('api', Array, -2)
#3 /home/wikitree/www/includes/api/ApiMain.php(340): ApiFormatXml-&gt;execute()
#4 /home/wikitree/www/includes/api/ApiMain.php(329): ApiMain-&gt;printResult(false)
#5 /home/wikitree/www/includes/api/ApiMain.php(210): ApiMain-&gt;executeAction()
#6 /home/wikitree/www/includes/api/ApiMain.php(195): ApiMain-&gt;executeActionWithErrorHandling()
#7 /home/wikitree/www/api.php(53): ApiMain-&gt;execute()
#8 {main}

</error>
</api>


The above is a little more readable when you follow the URL above. Remove the "&format=xmlfm" to see that this query returns valid JSON.

Could someone have a look to see if this can be repaired.

Thanks,

Doug

in WikiTree Tech by Doug Henderson G2G6 Mach 1 (10.0k points)
There's an API?

1 Answer

+1 vote
Hi Doug,

For your application, do you need both the JSON and the XML?

I'm wondering if the XML is really necessary.

Thanks,

Chris
by Chris Whitten G2G Astronaut (1.5m points)

Related questions

+8 votes
1 answer
370 views asked Jan 19, 2022 in WikiTree Tech by Ken McEvoy G2G6 Mach 1 (13.3k points)
+2 votes
1 answer
148 views asked Jan 25 in WikiTree Tech by Tomáš Kratina G2G2 (2.4k points)
+5 votes
1 answer
+6 votes
2 answers
188 views asked Jan 8 in WikiTree Tech by Michel Vorenhout G2G6 Pilot (321k points)
+7 votes
2 answers
+9 votes
3 answers
249 views asked Sep 28, 2022 in WikiTree Tech by Przemek Więch G2G5 (5.2k points)
+7 votes
3 answers
230 views asked Feb 1, 2022 in WikiTree Tech by Fairch Fairchild G2G3 (3.0k points)
+5 votes
1 answer
+26 votes
2 answers
+5 votes
0 answers
117 views asked Aug 1, 2021 in WikiTree Tech by Kay Knight G2G6 Pilot (616k points)

WikiTree  ~  About  ~  Help Help  ~  Search Person Search  ~  Surname:

disclaimer - terms - copyright

...