Integratec API Platform
Python

Open

1 # Import the wrapper
2 from opPyApi import *
3 
4 # Instantiate the object
5 api = opClientConnection()
6 
7 # Open a connection
8 api.open('127.0.0.1', 60000)

SendRequest

1 # Set input params
2 serviceId = 'getBrokerIdentity'
3 requestJson = '{}'
4 
5 # Generate a request
6 guid = api.sendRequest(serviceId, requestJson)

ReceiveReply

1 # Get the reply for the specified request ID with a timeout of 100ms
2 replyJson = api.receiveReply(guid, 100)

DeleteRequest

1 # Clean up record of the specified request
2 api.deleteRequest(guid)

SendRecvDelete

1 # Create a request, get the reply, and clean up the request
2 replyJson = api.sendRecvDelete(serviceId, requestJson, 100)

Close

1 # Close the client connection
2 api.close()

Status Callback

1 # Implement an example callback to print the id and status given by status
2 def statusCallback(connection, id, status):
3  print id.encode('utf-8')
4  print status.encode('utf-8')
5 
6 # Pass in the status callback pointer argument
7 api = OPApi('../path/to/your/local/install')
8 api.open('127.0.0.1', 60000, statusCallback)