Board Thread:Support Requests - Getting Technical/@comment-43962992-20191030052121

Hi folks. I'm trying to figure out a way to create new pages programattically, through the API documented at: https://community.fandom.com/api.php

I'm having errors with my python code, and would like to step through the process manually, with curl

From reading the wiki, my understanding is this:

1.) obtain "token"

I do this with my python code as follows:

WIKI = "https://www.mediawiki.org/w/api.php"

R = S.get(url=WIKI, params=PARAMS) DATA = R.json LOGIN_TOKEN = DATA['query']['tokens']['logintoken']

sys.stderr.write(LOGIN_TOKEN + '\n')

2.) curl 'https://mycommunity.fandom.com/api.php?action=edit&title=Test&summary=test%20summary&text=article%20content&token=[LOGIN_TOKEN]'

That works, and I can feed in the desired content through string variables. However there's one thing I can't seem to figure out from the API documentation, and that's how to assign a category to the newly created page, so it shows up on a category "index" page using the DPL "CategoryTree" feature.

I see quite a bit in the API documentation on getting all pages in a certain category, etc. Just not seeing how to specify the category a page should be created under.

Thanks. 