Developer forum

Forum » CMS - Standard features » Using the query publisher for a webapi - do i have to use a query?

Using the query publisher for a webapi - do i have to use a query?

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

I am creating a small webapi for itembased data. Think the best way to do this as it stands, is to use the query publisher. But do i have to use a query in the url in order to get a specific item?

The standard way of working, is eg. like this www.mypage.com/api/item?itemid=12345

Is there any way of getting the same result using this structure? www.mypage.com/api/item/12345

ofcourse, the itemid is dynamic.

just wondering if I could do a cleaner structure. Is that possible? Or in other words, using the query publisher dynamically without a query :)

/Hans


Replies

 
Nicolai Pedersen
Reply

Yes as it is currently.

You can create rewrite rule in web.config if you want to do that. I cannot see what you will get out if it if you send the data in i.e. json...

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Ok, think i´ll just stick with the query.

thank you for your reply, Nicolai 👍🏻

/Hans

 

You must be logged in to post in the forum