Quickstart
This is a quick introduction, for a complete guide please go to Mopinion Client or Requesting Resources.
Instantiating the MopinionCLient
Credentials can be created via the Mopinion Suite at Integrations » Feedback API in the classic interface or in the Raspberry interface, provided your package includes API access.
You can also take a look at this
link
with the steps to get a private_key
and a public_key
.
>>> from mopinion import MopinionClient
>>> client = MopinionClient(public_key=YOUR_PUBLIC_KEY, private_key=YOUR_PRIVATE_KEY)
Checking for availability
>>> assert client.is_available()
Making a request
Request your account.
>>> response = client.resource("account")
>>> assert response.json()["_meta"]["code"] == 200
>>> response = client.get_account()
>>> assert response.json()["_meta"]["code"] == 200
Or request deployments.
>>> response = client.resource("deployments")
>>> assert response.json()["_meta"]["code"] == 200
>>> response = client.get_deployments()
>>> assert response.json()["_meta"]["code"] == 200
If you need further examples about requesting resources please go to Mopinion Client or Requesting Resources.