Extract data from hr module to flask application

I’m new to this, I am in a situation where I have to create a flask application which can send request to the HR module of ERP to get some data on which action will be performed and the calculated data will be sent back to the hrms I know importing and exporting data using csv, I have never worked with API, i tried it but its giving me not that i don’t have enough permissions, I’m not getting where or how to start can anyone please guide me with this, I’m not getting any satisfactory documentation for this

@Sneha_Manjunath here is the documentation . if you are facing any issues take screenshots so we can help you

Thanks for the reply, I’ll try it out

Im trying to write a 3rd party program in flask outside of erpnext and im not getting access to the end points im able to login to the erp using that program but unable to get the data using that end points, I tried by both the ’ usr name and password ’ and ‘token and key’ but im not getting it right

CookiePartitionedForeign=Partitioned cookie
or storage access was provided to “” because it is loaded in the
third-party context and storage partitioning is enabled.

Im getting this in my debug console where might have i gone wrong!!

from flask import Flask, request, jsonify
import requests

app = Flask(__name__)
erpnext_login_url = 'http://192.168.25.45:8000'
erpnext_employee_url = 'http://192.168.25.45:8000/api/resource/Employee'

@app.route('/', methods=['GET'])
def get_employee():
    # Prepare the payload for login.
    api_key = '6704c6ebe8251a3'
    api_secret = 'd86f9***'
    data = {
            'usr': api_key,
            'pwd': api_secret
        }

    login_response = requests.post(erpnext_login_url, data=data)

    if login_response.status_code == 200:
        cookies = login_response.cookies

        employee_response = requests.get(erpnext_employee_url, cookies=cookies)

        if employee_response.status_code == 200:
            employee_data = employee_response.json()
            return jsonify(employee_data)
        else:
            return jsonify({"error": "Failed to retrieve employee data"}), 500
    else:
        return jsonify({"error": "Failed to log in"}), 401

if __name__ == '__main__':
    app.run(debug=True)

This is my flask code can anyone say where might I be going wrong,
This url “erpnext_login_url” is not giving me any error but the url with the end points is giving me error