Hi Team,
https://help.dataminer.services/WebServices/#t=SLC_UM_DataMinerWebServices%2FWS_Methods_v0%2FConnect.htm
Can anyone please help me to understand why the following python code to make an API call to dataminer does not work
import requests
headers1 = {
"host": "localhost",
"Content-Type": "application/x-www-form-urlencoded"
}
data1 = {
"Login": "XXX",
"Password": "XXX",
"connection" : "10df979a-6bbd-412b-9182-66a38f0ec4eb",
"dmaID":"41303",
}
r = requests.post("http://10.207.7.224/api/v0/Connection", headers = headers1, data=data1)
print(r.text)
Hi Daniel,
Checking the payload ('data1') in your question, it seems that it is not correct. According to DataMiner Help (DataMiner WebService: Connect), the following entries are required:
- Connection: The IP address or the host name where the DMA is running
- Login: User name
- Password: The password
Based on this, the payload 'data1' should be defined as follows:
data1 = {
"Connection" : "10.1.2.3",
"Login": "myUser",
"Password": "myPassword"
}
The result of this query will be the connection ID (in your case, this is stored in the variable 'r'). With the connection ID, you can start querying data from the DMA.