Updating a section of a page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Updating a section of a page

santosh satapathy
Hi there,

I am new to the media wiki. Any help on this below query is highly appreciated.

Query:
I have created a media wiki server and update a section of one particular page (a table of values) dynamically.

I am planning to do this using rest APIs referring to https://www.mediawiki.org/wiki/API:Tutorial 

What is the flow I should follow to edit a page? Should I use APIs to login first and then get the csrf token using another rest API and then finally update the page.

What is the exact sequence??


Thanks in advance

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
Reply | Threaded
Open this post in threaded view
|

Re: Updating a section of a page

Srishti Sethi
Hello Santosh,

For editing a page using the rest API, here is what the sequence would be like: 

1) Get the login token 
2) Use the token obtained in Step 1 to login 
3) Get an additional token to edit
4) Make edit using the token obtained in Step 3

Did you look at the python example in the edit API tutorial https://www.mediawiki.org/wiki/API:Edit#Editing_via_Python? You could follow the Python script to learn what API calls you will need for this. 

Best,
Srishti

On Mon, Jul 31, 2017 at 9:13 AM, santosh satapathy <[hidden email]> wrote:
Hi there,

I am new to the media wiki. Any help on this below query is highly appreciated.

Query:
I have created a media wiki server and update a section of one particular page (a table of values) dynamically.

I am planning to do this using rest APIs referring to https://www.mediawiki.org/wiki/API:Tutorial 

What is the flow I should follow to edit a page? Should I use APIs to login first and then get the csrf token using another rest API and then finally update the page.

What is the exact sequence??


Thanks in advance

_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api




--
Srishti Sethi
Developer Advocate
Technical Collaboration team
Wikimedia Foundation


_______________________________________________
Mediawiki-api mailing list
[hidden email]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api