Forum

Post a new question

Categories:

Tags:

FAQ: I cannot call API from command line

API
Yury Udovichenko 2014-09-30 06:33:20 UTC in WMSPanel functionality

Q: I have API enabled for my account and I have my IP added to the white list according to this instruction: blog.wmspanel.com/2014/08/wmspanel-real-time-stats-api.html

When I make this call:
# wget https://api.wmspanel.com/v1/data_slices?client_id=aaaaaaaa&api_key=bbbbbb
it returns 403 response. When I make this call from browser, it succeeds.

What might be the problem?

Yury Udovichenko 2014-09-30 06:35:10 UTC

A: Please quote the URL which you use for the call. Like this:

# wget 'https://api.wmspanel.com/v1/data_slices?client_id=aaaaaaaa&api_key=bbbbbb'

Because otherwise the ampersand sign is processed as a launch of second command.
This is why this could be launched from browser and couldn't be launched from command line for you. And it will be working fine when calling from your scripts.

Post a reply



This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the Privacy Policy. If you want to know more or withdraw your consent to all or some of the cookies, please refer to the Privacy Policy.
By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to the use of cookies.