I am encountering an error using the API

+5 votes
149 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 (7.3k points)
There's an API?

1 Answer

0 votes
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.3m points)

Related questions

+3 votes
0 answers
62 views asked Aug 1 in WikiTree Tech by Kay Knight G2G6 Pilot (418k points)
+7 votes
1 answer
196 views asked Apr 10, 2020 in WikiTree Tech by Brian Casey G2G Crew (340 points)
+18 votes
1 answer
348 views asked Jul 19, 2019 in WikiTree Tech by Jamie Nelson G2G6 Pilot (360k points)
+4 votes
1 answer
173 views asked Mar 25, 2019 in WikiTree Tech by ing C.J.S. Vonk G2G Crew (440 points)
+8 votes
1 answer
161 views asked May 20, 2016 in WikiTree Tech by AleŇ° Trtnik G2G6 Pilot (559k points)
+4 votes
2 answers
101 views asked May 15, 2016 in WikiTree Tech by Doug Henderson G2G6 (7.3k points)
+18 votes
1 answer
376 views asked Jul 10, 2015 in The Tree House by Chris Whitten G2G Astronaut (1.3m points)
+19 votes
3 answers
665 views asked Jan 27, 2017 in WikiTree Tech by Greg Shipley G2G6 Mach 6 (69.1k points)
+4 votes
1 answer
85 views asked May 16, 2016 in WikiTree Tech by Doug Henderson G2G6 (7.3k points)

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

disclaimer - terms - copyright

...