Page 1 of 1

Question about using the 'Add by Url' api

Posted: March 21st, 2012, 6:50 am
by NzbPewPew
Hi folks,

I'm reading the api wiki about how to add an nzb via url.

The docs say this: -

Shortest way:

Code: Select all

URL: api?mode=addurl&name=http://www.example.com/example.nzb&nzbname=NiceName
The url i want to try and parse is

Code: Select all

https://www.pewpew.asadsa/api?t=get&guid={0}&apikey={1}&o=json
notice how my url has a few extra params? is that ok?

cause that means, i would need to do this... and i'm not sure if this is right ..


Code: Select all

URL: api?mode=addurl&name=https://www.pewpew.asadsa/api?t=get&guid={0}&apikey={1}&o=json&nzbname=NiceName
(of course, i would replace {0} and {1} with the correct info ...

so .. can that work?

(i'm at work, and can't try this .. so i was hoping someone can confirm for me, please).

-ce moi-

Re: Question about using the 'Add by Url' api

Posted: March 21st, 2012, 7:15 am
by shypike
You need to do proper URL quoting, where you replace all meta-characters by %00 symbols.
https://www.pewpew.asadsa/api?t=get&gui ... {1}&o=json
will become:
https%3A%2F%2Fwww.pewpew.asadsa%2Fapi%3Ft=get%26guid={0}%26apikey={1}%26o=json

Re: Question about using the 'Add by Url' api

Posted: March 21st, 2012, 8:26 am
by NzbPewPew
ya. confirmed to work.

(I would have never thought about url encoding that param).

Woot!