Hi, The error doesn't seem to be related to combining claims and labels or the structure of payload for the edit. I think it's the error on how you say what item needs to be edited. You can set either id (Q12345) or both page and site (enwiki, Foo) but not both.
If you still have trouble, please drop the segment of the code somewhere so I can take a look and help. HTH Am Sa., 12. Okt. 2024 um 19:48 Uhr schrieb tohuuu <t...@tohuuu.de>: > Hi all, > > is there a way to set both SDC labels and SDC claims in one single > wbeditentity API call? I tried to pass a dictionary with the following > structure as data payload: > > {'claims': [{...}, {...}, {...}], 'labels': {'de': 'german...', 'en': > 'english ...'}} > > but this triggerend an API error: > > pywikibot.exceptions.APIError: not-recognized-array: An array was > expected, but not recognized. > > Based on this error message, I assumed that the labels should get passed > as list, too: > > {'labels': [{'language': 'de', 'value': 'de...'}, {'language': 'en', > 'value': 'en...'}], 'claims': [{...}, {...}, {...}]} > > but that gave me a different error: > > pywikibot.exceptions.APIError: param-illegal: You need to provide either > an entity "id", or a "site" and "page" combination, but not both. > > Am I doing something wrong? Or is setting both SDC labels and SDC claims > not supported? > > Thanks for any help! > > Florian > > > _______________________________________________ > pywikibot mailing list -- pywikibot@lists.wikimedia.org > Public archives at > https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/MIPENXF2M34B3YSXVX25JARZHSLOAYVV/ > To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org > -- Amir (he/him)
_______________________________________________ pywikibot mailing list -- pywikibot@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/pywikibot@lists.wikimedia.org/message/TT4WXOAD5NIAHDH7PAZW33PCI5CNBHGP/ To unsubscribe send an email to pywikibot-le...@lists.wikimedia.org