Create a meter.
Scopes: meters:write
import polar_sdk
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.meters.create(request={
"name": "<value>",
"filter_": {
"conjunction": polar_sdk.FilterConjunction.OR,
"clauses": [],
},
"aggregation": {
"func": "count",
},
"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
})
# Handle response
print(res)
{
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "<string>",
"operator": "eq",
"value": "<string>"
}
]
},
"aggregation": {
"func": "count"
},
"organization_id": "<string>"
}
You can generate an Organization Access Token from your organization's settings.
Meter created.
The response is of type object
.
Was this page helpful?
import polar_sdk
from polar_sdk import Polar
with Polar(
access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:
res = polar.meters.create(request={
"name": "<value>",
"filter_": {
"conjunction": polar_sdk.FilterConjunction.OR,
"clauses": [],
},
"aggregation": {
"func": "count",
},
"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
})
# Handle response
print(res)
{
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "<string>",
"operator": "eq",
"value": "<string>"
}
]
},
"aggregation": {
"func": "count"
},
"organization_id": "<string>"
}