I'm using the BullionVault API to view my orders.

I use the requests from the official documentation https://www.bullionvault.com/help/xml_api.html and python language.

My issue is the request response is the HTML DOM of the BullionVault login page.

Here is my code:

login_page_url = "https://or.bullionvault.fr/secure/login.do"
login_page_url2 = "https://live.bullionvault.com/secure/j_security_check"
payload2 = {'j_username': 'myusername', 'j_password': 'mypassword'}

with requests.Session() as s:
    a = s.get(login_page_url)
    print(s.cookies)
    b = s.get(login_page_url2, params = payload2)
    c = s.get("https://or.bullionvault.fr/secure/view_orders_xml.do")

    print(a)      #output status 200
    print(b)      #output status 200
    print(c)      #output status 200
    print(c.text) #output HTML DOM 

What I am doing wrong ?

Issue solved :
There were missing parameters.

    login_page_url = "https://or.bullionvault.fr/secure/login.do"
    login_page_url2 = "https://live.bullionvault.com/secure/j_security_check"
    payload2 = {'j_username': 'myusername', 'j_password': 'mypassword'}
    payload3 = {'confirmed': 'true'}
    payload4 = {'simple': 'true'}

    with requests.Session() as s:
        # fetch the login page
        a = s.get(login_page_url)       
        #b = s.get(login_page_url2, params = payload2)  
        b = s.post(login_page_url2, data = payload2)
        c = s.get("https://live.bullionvault.com/secure/api/v2/view_orders_xml.do", params = payload3)
        d = s.get("https://live.bullionvault.com/secure/api/v2/view_balance_xml.do", params = payload4)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.