IBM / api-samples

Samples code that uses QRadar API's
Apache License 2.0
198 stars 82 forks source link

Can I have a simplest Api usage example #14

Open sftranna opened 7 years ago

sftranna commented 7 years ago

hi there, I am working on an app. I have tried to call an Api but this never authenticate the credentials provided in the code rather at console this asks for credentials like "what is the ip of qradar console required to make this Api call" and username password and stored these in a flat file at C:......\administrator.qradar_appfw.auth

Here is the code for calling an api Username='ABC' Pwd='cuz' Ip='xxx.xxx.xxx.xxx' userpass=username + ':' + pwd Encodecred= b"Basic "+base64.b64encode(userpass.encode('ascii')) headers = {'SEC': 'ABSBDHDJDJDJJDJDJDJ'} headers = {'Authorization': Encodecred} xurl = 'https://'+Ip+'api/endpoint' reaponse=qpylib.Rest('GET', xurl, headers = headers)

Plz guide me about the problem so that I can verify credentials through code password or SEC but not from .qradar_appfw.auth. Thanks in advance

Can you plz provide a simplest working example with a basic tutorial mentioning all the step (like getting authorization code, ssl certificate and all that) required before running that code? I have done a lot of R&D but failed.

Thanks PS- plz don't point any formatting errors as typed every bit here on mobile (didn't copy paste)