Local API for Routine Automation Operations


1. Add parameter notifications=2 to the startup interface to disable the website notification box.

http://127.0.0.1:35000/api/v1/profile/start?profileId=xxxxxxxxxxx&skiplock=true&notifications=2

2. Mouse click: GET passes x , y coordinates is the mouse click coordinates, the upper left corner of the page is 0,0 basis point.

http://127.0.0.1:35000/api/v1/profile/page/mouseclick?x=400&y=500&profileId=xxxx

Return example:

{"status":"OK","success":true,"value":"{}"}

If success = true, the execution is successful.


3. Mouse wheel: GET passes x , y coordinates as the mouse coordinates, deltaY is the scrolling value of the wheel up and down, negative is upward scroll, positive is downward scroll.

http://127.0.0.1:35000/api/v1/profile/page/mousewheel?x=400&y=500&deltaX=0&deltaY=50&profileId=xxxx

Return example:

{"status":"OK","success":true,"value":"{}"}

If success = true, the execution is successful.



4. Page information query: GET profileId profile ID, you can read the URL of the current page, the title, whether to load the complete information.

http://127.0.0.1:35000/api/v1/profile/page/pagestate?profileId=xxxx

Return Example 1:

{"status":"OK","value":"","success":true,"baseURI":"https://www.vmlogin.us/", "readyState":"interactive","title":"Bing"}

Return Example 2:

{"status":"OK","value":"","success":true,"baseURI":"https://www.vmlogin.us/","readyState":"complete","title":"Bing"}

If success = true means successful execution, baseURI is the current page URL, and readyState is page load complete. title is the title.


5. Forward

http://127.0.0.1:35000/api/v1/profile/historyforward?profileId=xxxx



6. Back

http://127.0.0.1:35000/api/v1/profile/historyback?profileId=xxxx

7. Optimize the proxy detection interface (Add the active timeout parameter timeout milliseconds, timeout automatically returns)

http://127.0.0.1:35000/api/v1/proxy/test?proxytype=socks5&proxyserver=127.0.0.1&proxyport=1080&proxyusername=&proxypassword=&timeout=8000

Indicates that if the detect proxy does not have results for 8 seconds it does not wait and fails to return.



8. Refresh the page

http://127.0.0.1:35000/api/v1/profile/refresh?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx



9. The current tab to open the specified URL

http://127.0.0.1:35000/api/v1/profile/openurl?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&url=www.vmlogin.us



10. Get the source code of the web page

http://127.0.0.1:35000/api/v1/profile/source?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx



11. Take the attribute value of the specified element

http://127.0.0.1:35000/api/v1/profile/getAttribute?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&args=[{"ELEMENT": "95365abe-6746-4703-8cfd-6316580f5289", "element-6066-11e4-a52e-4f735466cecf": "95365abe-6746-4703-8cfd-6316580f5289"}, "style"]

Generally, the args parameter is a JSON string that combined with Element_ID which obtained after findElement performs find element operation.

For example:

 [{"ELEMENT": "95365abe-6746-4703-8cfd-6316580f5289", "element-6066-11e4-a52e-4f735466cecf": "95365abe-6746-4703-8cfd-6316580f5289"}, "value"]

The above example is take the value of the 95365abe-6746-4703-8cfd-6316580f5289 element.



12. Perform element click operation through the selector

http://127.0.0.1:35000/api/v1/profile/findElement?profileId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&function=findElementByID&args=kw&click=true&index=-1




13. Send text to web page

First, you can use findElementByID to find the elementId of the element, for example:

http://127.0.0.1:35000/api/v1/profile/findElement?profileId=xxxxxxxx -xxxx-xxxx-xxxx-xxxxxxxxxxxx&function=findElementByID&args=kw&click=false&index=-1

You can also use: findElementByXPath to find the elementId of an element, for example:

http://127.0.0.1:35000/api/v1/profile/findElement?profileId=xxxxxxxx -xxxx-xxxx-xxxx-xxxxxxxxxxxx&function=findElementByXPath&args=Ly8qW0BpZD0ia3ciXQ==&click=false&index=-1

The args parameter above is transmitted using base64 encoding, and is decoded as: //* [@ id="kw"]

The GET request above will return:

{"status":"OK","value":"{\"element-6066-11e4-a52e-4f735466cecf\":\"49e49e71-2a55-4e79-a41b-86840ffd18c8\"}"}

49e49e71-2a55-4e79-a41b-86840ffd18c8 is the elementId to be used.

http://127.0.0.1:35000/api/v1/profile/sendKeys?profileId=xxxxxxxx -xxxx-xxxx-xxxx-xxxxxxxxxxxx&elementId=49e49e71-2a55-4e79-a41b-86840ffd18c8&value=5Lit5paHYWJjMTIz

The above value is also transmitted using base64 encoding to prevent the GET transmission failure. Value=5Lit5paHYWJjMTIz, that is, to send Chinese abc123 string in this web control. Note that these automatic operations can only be performed after the web page is loaded, otherwise, the actions may be blocked.

The 35000 port here is the port set in "My account" in the VMLogin client software. Please pay attention to opening and changing it.



14. Client restart interface

http://127.0.0.1:35000/api/v1/client/restart



15. Test proxy interface

http://127.0.0.1:35000/api/v1/proxy/test?proxytype=socks5&proxyserver=127.0.0.1&proxyport=1080&proxyusername=&proxypassword=

proxytype parameters: socks5/socks4/http/https

{"status":"ERROR", "value":"Failed to test the proxy server."}
{"status":"OK", "value":"country:HK\r\ncity:Central\r\nregion:HCW\r\ntz:Asia\/Hong_Kong\r\n"}

http://127.0.0.1:35000/api/v1/proxy/test?proxytype=socks5&proxyserver=127.0.0.1&proxyport=1080&proxyusername=&proxypassword=&urlindex=0

url_index   =  0    lumtest (Lumi detection IP address)

url_index   =  1    VMLogin (VMLogin IP database,support IPV6 detection)

url_index   =  2    ip-api.com (ip-api database)

16. Settings: Warn if the password has suffered a data leak, enable=false turn off the warning

http://127.0.0.1:35000/api/v1/profile/browser/password_manager_leak_detection?profileId=xxxxxx&enable=false



17. Import address API:

http://127.0.0.1:35000/api/v1/profile/addresses/import

② POST  

③ profileId

④ body (JSON need base64 encode):  

[{"name_on_card":"vmlogin","nickname":"vmlogin","card_number":"1111123456789","expiration_month":8,"expiration_year":2023}]




18. Import payment method API:

http://127.0.0.1:35000/api/v1/profile/credit_cards/import

② POST

③ profileId

④ body (JSON need base64 encode): 

[{"organization":"vmlogin ltd","street_address":"vmlogin  100","district":"Shushan","city":"hefei","province":"Anhui","zipcode":"230088","country_code":"CN","number":"13988888",

"full_name":"dawang","email":"cs@vmlogin.us"}]