Why i need to add my ipaddress to access the whmcs rest api? - spring-boot

i am new to WHMCS API and i just want call WHMCS API from my spring boot rest template and i am tired of adding my ip address to WHMCS->General Setting->Security->API IP Access Restriction.

According to WHMCS docs, it is a requirement:
API IP Access Restriction
Advanced. If using the WHMCS API from an off-server location, you must
specify the IP address here, otherwise access will be denied.
You can submit a feature request with your concerns so that they may consider an alternative in the future.
Edit:
According to WHMCS developer documentation, you can bypass IP Address restriction by using api access key in the configuration.php file:
$api_access_key = 'secret_key_passphrase_goes_here';
then access api with the following URL:
whmc-url.com/includes/api.php?action=xxxx&username=xxx&password=xxx&accesskey=secret_key_passphrase_goes_here

Related

Using 2 Google API keys in same project?

I have a project which I use Google Places API.
For the API key I have now, I have set IP restriction because the API is called in server-side. Place Search and Place Details are called in Server and returned to client side.
But the endpoint Place Photos, I call in client side, and of course it doesn't work because I have set IP restriction. So, my idea is to create one more production api key which works on client side and set HTTP referrers. Is this Ok? Or should I call all apis in server-side instead?

AWS API gateway: Custom domain supporting multiple Http APIs

I have created two lambda functions
register
login
and both of them are getting triggered from respective "Http APIs" in the API gateway. I have set up the stage for both of them as prod. Now I want to call them using my custom subdomain e.g prodapi.mydomain.com by setting the path as "v1"
prodapi.mydomain.com/v1/register
prodapi.mydomain.com/v1/login
I am able to achieve it for a single API but when I try to do API mapping for the other one using the same path, it doesn't allow that and says "ApiMapping key already exists for this domain name".
Any suggestion on how to achieve this?
can you share the endpoint url, before adding the subdomain, and after adding the subdomain
And can you explain your endpoints, how it should look like before adding the subdomain and after

Start gateway with Key to validate config then use Bearer token for querying

I have an eco system that the gateway and federated services live. The problem is when the gateway starts it validates the services - to do this it needs to be authorised.
When a client is querying via federation gateway they supply a bearer token.
In both instances the request header authorization field is used.
I've read and reread the docs but I am unable to achieve this using different tokens for different actions.
Anyone any ideas or links to relevant docs?
Cheers
Rereading for the Xth time the solution is with the "buildService".
It is only called once for each implementing service. You can extend it and add whatever headers you need.
See here for docs + example:
enter link description here

getting REQUEST_DENIED ("This service requires an API key.") but no error in the API console

I just added Google Places API Web Service to my project, added an API key (unrestricted, for testing) and I am copy pasting requests from the docs to try things out, for example:
curl https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=my_new_key
I only get Request Denied ("This service requires an API key."), but in the API console I do not see any errors. The key is really in the curl command line in my sample, the API is enabled in the console, the key is valid and not restricted. I cannot find a reason why this should not work?
Here are few things you could try...
API key is for the application but you should authorize that application in google before using it.
Check your API key again and see if theres any encoding required before using it.
Enable API from your google account.
See if theres any restriction on your API key for example :
Under Accept requests from these server IP addresses, enter the IP
addresses from which your key is to be accepted, one per line. You
may also enter a subnet using CIDR notation (e.g. 192.168.0.0/22).
Hope this helps..
Try this link.... very helpful
REQUEST DENIED with Google Places API KEY for Server Web used in an Android application

How do I get an API key from Podio without a return url?

I want to test the Podio API on my local machine. I don't have a website. When I go to this url to get an api key, it asks me for a return URL. How can I figure out how to use the Podio API without a return URL?
If you are not planning to use this api key in server-side auth flow then you can use any value as domain, otherwise it should be domain of return URL.
As it is described in more details here: https://developers.podio.com/authentication/server_side
The redirect_uri must be on the same domain as the domain you specified when you applied for your API Key.

Resources