Skip to content

Commit c8c54fc

Browse files
committed
feat(reports): add /campaigns/campaigns_conversion report to sdk
1 parent 4cd1df7 commit c8c54fc

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

livechat/reports/api/v37.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,35 @@ def unique_visitors(self,
540540
return self.session.post(f'{self.api_url}/customers/unique_visitors',
541541
json=payload,
542542
headers=headers)
543+
544+
# Campaigns
545+
546+
def campaigns_conversion(self,
547+
distribution: str = None,
548+
timezone: str = None,
549+
filters: dict = None,
550+
payload: dict = None,
551+
headers: dict = None) -> httpx.Response:
552+
''' Shows the number of campaigns sent and how many of those resulted in a chat or a goal.
553+
554+
Args:
555+
distribution (str): Allowed values: `hour`, `day`, `day-hours`, `month` or `year`. Defaults to `day`.
556+
timezone (str): IANA Time Zone (e.g. America/Phoenix).
557+
Defaults to the requester's timezone.
558+
When the requester's timezone isn't present, then `filters.from` is parsed to get the timezone.
559+
filters (dict): If none provided, your report will span the last seven days.
560+
payload (dict): Custom payload to be used as request's data.
561+
It overrides all other parameters provided for the method.
562+
headers (dict): Custom headers to be used with session headers.
563+
They will be merged with session-level values that are set,
564+
however, these method-level parameters will not be persisted across requests.
565+
566+
Returns:
567+
httpx.Response: The Response object from `httpx` library,
568+
which contains a server's response to an HTTP request.
569+
'''
570+
if payload is None:
571+
payload = prepare_payload(locals())
572+
return self.session.post(f'{self.api_url}/campaigns/campaigns_conversion',
573+
json=payload,
574+
headers=headers)

0 commit comments

Comments
 (0)