Post Reply
Posts: 105
Joined: Fri Jan 06, 2017 12:50 pm

How create report by API?

Post by awasu.user » Thu Jul 27, 2017 6:36 pm

Calling API:

http://localhost:2604/reports/create?fo ... &token=xxx

I try create report, but I get

Code: Select all

"errorMsg": "Missing request data." 
In doc is ... portConfig:

Code: Select all

<dataSource type="channelFolders" markItemsAsRead="yes" groupByChannel="yes" includeItems="all" includeSubFolders="no">
    <channelFolder id="..."> ... </channelFolder>
but how pass it by post in URL? I know how make post in python, but I can't how it should be look in URL?
datasource@type=channelFolder&datasource@markitemsread=yes ?

User avatar
Site Admin
Posts: 3068
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia

Re: How create report by API?

Post by support » Thu Jul 27, 2017 10:40 pm

You have to send an HTTP POST request; if you embed the parameters in the URL, it will be sent as an HTTP GET.

For example:

Code: Select all

import urllib.request

data = b"""<channelReport>
    <name> My New Report </name>
    <dataSource type="channelFilter">
        <channelFilterName> All </channelFilterName>

url = "http://localhost:2604/reports/create"
req = urllib.request.urlopen( url , data=data )
print( )

Post Reply

Return to “Awasu - Extensions”