Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Farha
Explorer

Python API Script to logging in checkpoint where i am able to logging in with Appstream Manually.

Hi Everyone, The Checkpoint of my organisation is able to login with AppStream manually where as not able to login with normal IP Address. So the same thing how can I connect to Checkpoint with API Code while using AppStream. 
As I went through API references we can connect to checkpoint with below url as 
(url = ("https://<ip>:<port>/web_api/login"))
The same how can I go while using AppStream login interface ?

0 Kudos
3 Replies
PhoneBoy
Admin
Admin

I assume you’re referring to the streamed version of SmartConsole, correct?
You should be able to get the necessary IP address by following a process similar to: https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-t...

0 Kudos
Farha
Explorer

HI, Even though I am not able to get 200 success for login through RestAPI below is my code
```

import requests
import base64
import json
import time
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)


def main():
try:
url = ("https://<ip>:<port>/web_api/login")
headers={
'content_type': 'application/json'
}
response = requests.post(url, headers=headers, verify=False, data={"user":"test","password":"test@123"})
print(response)
except Exception as e:
print(e)
if __name__ == '__main__':
main()
```
Getting 400 Request error.
NOTE: API is Enabled and published the change as well.


0 Kudos
PhoneBoy
Admin
Admin

Turns out getting the info from SmartConsole isn’t correct.
The information you need is actually in Infinity Portal and will be specific to your tenant.
See below for an example:

378DF47F-9C6B-496B-999E-983E6AB0F1D0.jpeg

0 Kudos
Upcoming Events

    CheckMates Events