awasu.user
Posts: 81
Joined: Fri Jan 06, 2017 12:50 pm

Postby 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 http://awasu.com/help/3.1/For%20developers/Awasu%20API/03-Reports.html#ReportConfig:

Code: Select all

<dataSource type="channelFolders" markItemsAsRead="yes" groupByChannel="yes" includeItems="all" includeSubFolders="no">
    <channelFolder id="..."> ... </channelFolder>
</dataSource>


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
support
Site Admin
Posts: 3021
Joined: Fri Feb 07, 2003 12:48 pm
Location: Melbourne, Australia
Contact:

Postby 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>
    </dataSource>
</channelReport>"""

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


Return to “Awasu - Extensions”

Who is online

Users browsing this forum: No registered users and 2 guests