How to get value from varibale

I try to get value from variable.

def get_value(self, channel_id, item_variable):
req_str = self._req_base+f"/channels/{channel_id}/variable?variable={item_variable}"
r = requests.get(req_str, auth=(self._username, self._password))
return r
http://XX.XX.XXX.XXX:8088/ari/channels/channelID/variable?variable=filial&api_key=

But I received Error 405

Where is requests.get defined?

What does ‘f"…"’ mean in the language that you are using?

One had to read carefully to find out that this was about ARI.

you might need to get a look at this https://wiki.asterisk.org/wiki/display/AST/Using+Swagger+to+Drive+ARI
otherwise 405 means “method not allowed”, so GET is no good for that endpoint,
also to simplify your test, you could authenticate directly in the req_str by appending : &api_key=username:pass

Thanks. I resolved the problem.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.