Implement ReplyKeyboardMarkup in POST url - telegram-bot

How to implement ReplyKeyboardMarkup in POST qwery for sendMessage method?
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup= ..... ?

If you want to pass json as parameters in URL, you should encode it. So a URL like this:
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup={"keyboard": [["Button"]]}
changes to:
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=123&text=test&reply_markup=%7B%22keyboard%22%3A+%5B%5B%22Button%22%5D%5D%7D
You can use online URL encoder/decoder like this one.
More information on URL encoding:
https://en.wikipedia.org/wiki/Percent-encoding

Related

Why I only getting id's back in response? IGDB api

I already read the documentation and I think I am making the simplest request in the correct way, but it always returns only the IDs, instead of all the fields of the games
Documentation example: Documentation Example
The request header is fine. I know this because I can get the expected request if fields = * as querystring
this is my request:
You have to provide the fields you want inside the body.
Like this:
fields age_ratings,aggregated_rating,aggregated_rating_count,alternative_names,artworks,bundles,category,checksum,collection,cover,created_at,dlcs,expansions,external_games,first_release_date,follows,franchise,franchises,game_engines,game_modes,genres,hypes,involved_companies,keywords,multiplayer_modes,name,parent_game,platforms,player_perspectives,rating,rating_count,release_dates,screenshots,similar_games,slug,standalone_expansions,status,storyline,summary,tags,themes,total_rating,total_rating_count,updated_at,url,version_parent,version_title,videos,websites;"

URL Parameters for API

I am trying to connect to this API endpoint, some parameters such as roomTypes and addOns require more parameters inside them. What should the URL be like?
Here is what I am trying, unsuccessfully:
https://api.lodgify.com/v2/quote/308200/?arrival=2020-10-02&departure=2020-10-07&propertyId=308200&roomTypes=[Id=373125, People=5]&addOns=[]
See image of Documentation
The correct format of parameters are as following:
https://api.lodgify.com/v2/quote/{PropertyID}?arrival={DATE}&departure={DATE}&roomTypes[0].id={RoomID}&roomTypes[0].people={PEOPLE}
It seems like you have space (white space) between Id and People in your URL, an URL must not contain a literal space

How to make seo url for Yii $_GET method using url manager?

I'm working on a site on local server. I have made a form to search country,state and city. After getting the results I see the URL formatted as URL
I want to make this URL as URL
So here I want to know about URL manager rules so I can make it as I want.
Simply add this rule in your url-manager
"site/searchme/<country>/<state>/<city>" => "site/searchme"
Now, you need to have an action with this signature:
public function actionSearchme($country, $state, $city)
You can access $country, $state, $city from url inside this action. For example if your url be like http://localhost/yii_1/site/searchme/UnitedStates/Washington/NewYork, $country will equal "UnitedStates" and so on.

Yii transform url from param/param/param/ to param/param?param

Suppose I have a url like:
site.com/param1/value1/param2/value2/param3/value3/param4/value4
I need to convert this url when a user writes it in url line to:
site.com/param1/value1/param2/value2?param3=value3&param4=value4
P.S. - the number of parameters is variable.
How can I do it?
You need to change the UrlManager Rules according to the situation.
You need to configure the Url manager to handle the first two params as path url and let the rest

Google Reader Api mark All item As read

This is how my url looks be:
https://www.google.com/reader/api/0/mark-all-as-read?s=http://www.campionatoseriea.net&ts=1345114937
I can't understand why it doesn't work! I'm successfully logged in.
* EDIT *
https://www.google.com/reader/api/0/mark-all-as-read?s=feed/http://www.campionatoseriea.net/feed&ts=1346843394
I tried also this query but it doesn't work!
Try including the token parameter (T).
https://www.google.com/reader/api/0/mark-all-as-read?s=feed/http://www.campionatoseriea.net/feed&ts=1346843394&T=//cDr2ct8ynZS2I-P4x4cn1A
This document describes how to get a token.
?s=http://www.campionatoseriea.net
In the s you must pass the feed ID, not url. Here is example:
?s=feed/http://www.gsmarena.com/rss-news-reviews.php3