Thread:Project:Support desk/How to get the edit Token and use Edit API

I intend to use mediawiki API:Edit to edit wiki pages. But I need to get the edit Token first. How can I get that? Do I need to use mediawiki API:login to log in first? Are login token and edit token the same thing? When I use API to log in, how can I get the edit token? Where can I get the value of token if I use action=tokens? I hope someone can help clear my mind. Thanks in advance!