JDownloader Community - Appwork GmbH
 

Go Back   JDownloader Community - Appwork GmbH > International Support > JDownloader 2
Reply
 
Thread Tools Display Modes
  #1  
Old 08.08.2018, 12:44
Alexei Alexei is offline
Baby Loader
 
Join Date: Aug 2018
Posts: 5
Default JDownloader API PackageQuery format

Hi, I'm trying to use API for my.jdownloader, but I can't find correct way to use '/downloadsV2/queryPackages'

I implemented encryption and functions that use simple parameters (or no parameters) like '/contentV2/getFavIcon' or '/downloadsV2/packageCount'
but when I try to use complex parameters - it writes that something wrong

this request:
Code:
{
	"apiVer": 1,
	"url": "/downloadsV2/queryPackages",
	"params": [
		{
			"maxResults": 20,
			"startAt": 0
		}
	],
	"rid": 6
}
produces this answer:
Code:
{
  "type" : "BAD_PARAMETERS",
  "data" : "{maxResults=20, startAt=0}",
  "src" : "DEVICE"
}
Simple requests like:
Code:
{
	"apiVer": 1,
	"url": "/downloadsV2/getFavIcon",
	"params": [
		"ul.to"
	],
"rid": 5
}
Are working fine

Also I tried this variant:
Code:
{
	"apiVer": 1,
	"url": "/downloadsV2/queryPackages",
	"params": [
		{
			"queryParams": {
				"maxResults": 20,
				"startAt": 0
			}
		}
	],
	"rid": 6
}
without success
Code:
{
  "type" : "BAD_PARAMETERS",
  "data" : "{queryParams={maxResults=20, startAt=0}}",
  "src" : "DEVICE"
}
what is wrong?
Reply With Quote
  #2  
Old 08.08.2018, 13:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

params must be JSON representation of your parameters

try
Code:
"params": ["{\"maxResults\": 20,\"startAt\": 0}"],
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 08.08.2018, 13:01
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

You can also contact us via support@jdownloader.org or livechat (irc, freenode, #jdteam)
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 08.08.2018, 13:06
Alexei Alexei is offline
Baby Loader
 
Join Date: Aug 2018
Posts: 5
Default

Thanks!
This variant is working:
Code:
	{
		"apiVer": 1,
		"url": "/downloadsV2/queryPackages",
		"params": [ "{\"maxResults\":20,\"startAt\":0}" ],
		"rid": 97386062
	}
So logic is:
1. If parameter is JSON primitive it passed as is
2. If parameter is complex object - it is encoded as string?
Reply With Quote
  #5  
Old 08.08.2018, 13:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,554
Default

yes. in the end, there are only strings
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 07:15.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.