Skip to content

Latest commit

 

History

History
226 lines (158 loc) · 7.99 KB

MetricApi.md

File metadata and controls

226 lines (158 loc) · 7.99 KB

crowdemotion_api_client_python.MetricApi

All URIs are relative to https://api.crowdemotion.co.uk/v1

Method HTTP request Description
metric_get GET /metric List all registered metrics
metric_metric_id_delete DELETE /metric/{metric_id} Delete a Metric
metric_metric_id_get GET /metric/{metric_id} Find a Metric
metric_post POST /metric Create Metric

metric_get

list[Metric] metric_get(skip=skip, limit=limit, where=where, sort=sort)

List all registered metrics

Metrics are linked to time-series and define their meaning.

Common metric ID are listed below:

idValue
1Timestamp
2Neutral
3Happiness
4Surprise
5Puzzlement
6Disgust
7Fear
8Sadness

Permissions: ✗ Respondent ✗ Customer ✓ Manager

Example

import time
import crowdemotion_api_client_python
from crowdemotion_api_client_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
crowdemotion_api_client_python.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# crowdemotion_api_client_python.configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = crowdemotion_api_client_python.MetricApi()
skip = 56 # int | The number of results to skip. (optional)
limit = 56 # int | The maximum number of results to return. (optional)
where = 'where_example' # str | JSON formatted string condition. (optional)
sort = 'sort_example' # str | Attribute used to sort results. (optional)

try: 
    # List all registered metrics
    api_response = api_instance.metric_get(skip=skip, limit=limit, where=where, sort=sort)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling MetricApi->metric_get: %s\n" % e

Parameters

Name Type Description Notes
skip int The number of results to skip. [optional]
limit int The maximum number of results to return. [optional]
where str JSON formatted string condition. [optional]
sort str Attribute used to sort results. [optional]

Return type

list[Metric]

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metric_metric_id_delete

Metric metric_metric_id_delete(metric_id)

Delete a Metric

Permissions: ✗ Respondent ✗ Customer ✓ Manager

Example

import time
import crowdemotion_api_client_python
from crowdemotion_api_client_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
crowdemotion_api_client_python.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# crowdemotion_api_client_python.configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = crowdemotion_api_client_python.MetricApi()
metric_id = 56 # int | ID of Metric to be deleted.

try: 
    # Delete a Metric
    api_response = api_instance.metric_metric_id_delete(metric_id)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling MetricApi->metric_metric_id_delete: %s\n" % e

Parameters

Name Type Description Notes
metric_id int ID of Metric to be deleted.

Return type

Metric

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metric_metric_id_get

Metric metric_metric_id_get(metric_id)

Find a Metric

Metrics are linked to time-series and define their meaning.

Common metric ID are listed below:

idValue
1Timestamp
2Neutral
3Happiness
4Surprise
5Puzzlement
6Disgust
7Fear
8Sadness

Permissions: ✗ Respondent ✗ Customer ✓ Manager

Example

import time
import crowdemotion_api_client_python
from crowdemotion_api_client_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
crowdemotion_api_client_python.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# crowdemotion_api_client_python.configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = crowdemotion_api_client_python.MetricApi()
metric_id = 56 # int | ID of Metric to find.

try: 
    # Find a Metric
    api_response = api_instance.metric_metric_id_get(metric_id)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling MetricApi->metric_metric_id_get: %s\n" % e

Parameters

Name Type Description Notes
metric_id int ID of Metric to find.

Return type

Metric

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

metric_post

Metric metric_post(body)

Create Metric

Permissions: ✗ Respondent ✗ Customer ✓ Manager

Example

import time
import crowdemotion_api_client_python
from crowdemotion_api_client_python.rest import ApiException
from pprint import pprint

# Configure API key authorization: api_key
crowdemotion_api_client_python.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# crowdemotion_api_client_python.configuration.api_key_prefix['Authorization'] = 'Bearer'

# create an instance of the API class
api_instance = crowdemotion_api_client_python.MetricApi()
body = crowdemotion_api_client_python.MetricCreation() # MetricCreation | Request body

try: 
    # Create Metric
    api_response = api_instance.metric_post(body)
    pprint(api_response)
except ApiException as e:
    print "Exception when calling MetricApi->metric_post: %s\n" % e

Parameters

Name Type Description Notes
body MetricCreation Request body

Return type

Metric

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]