Guidance to use frappe REST API?

Is there any step by step guidance on how to use the frappe’s REST API from authorization until doing the task?
I found there are 3-4 pages in,, and Frappe · GitHub but they are all pieces of information which I can’t relate the methods explained.
I also found some websites maintain by users but they are for advance use.

I need it because i’m not an advance user and just learning to code.
Thank you.

For example,
#1. I do this returns the expected result (from Simple Authentication):

curl -X POST \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -d '{"usr":"Administrator","pwd":"admin"}'

#2. and doing this:

also return as expected {"message":"Logged In","home_page":"/desk","full_name":"Administrator"}

#3. but doing this:'', auth=("Administrator", "admin"))

return <Response [401]>

The correct one for this is:

params = (
    ('usr', 'Administrator'),
    ('pwd', 'admin'),
)'', params=params)

that will give <Response [200]>

#4. and doing:

fetch('', {
    method: 'POST',
    headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
    body: JSON.stringify({
        usr: 'Administrator',
        pwd: 'admin'
.then(r => r.json())
.then(r => {

return result: TypeError: Not allowed to request resource
But the last one is js, right?

Hello . Try this Frappe Ajax Call


Thanks @jervz09,

I actually want to do it on python. But I’ll certainly take a look at that page also.

we can login using simple authentication but same url showing error with token based authentication, why so?