How to use rest_url_prefix filter in wordpress - wordpress-rest-api

How can I modify the WordPress REST API endpoint for my custom API endpoints only?
I'm using the WC API 2.6 also and I do not want to modify the endpoint for them. I just want to change the request endpoints for my custom API.
My API is builtĀ on WC_REST_Controller which further extends the WP_REST_Controller class.

Related

Set $default route in API gateway for REST APIs

I have some REST APIs my backend server listens for (I used node express).
I want to use my friendly url api.mywebsite.com to forward all routes to horribleuglybackendname.aws.com, e.g.
api.mywebsite.com/some/route -> horribleuglybackendname.aws.com/some/route
I want to use API gateway to simply forward any routes to my backend. If I create a HTTP API (not REST) this seems easy to do but if I create a REST API I cannot see how to configure it. Perhaps you can't? If you can't why not? What is the alternative?
Thanks
So it seems $default is for HTTP APIs only. The UI is different between HTTP and REST API configuration. If you want to do a catch-all route for REST APIs you need to use {proxy+}.
This is good (ctrl-f for catch-all and you should be set)
https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/

DocuSign SOAP API for User list

I am trying to get the users associated with DocuSign account using SOAP API.
I tried API GetMembershipSummary(), but is giving an error "Invalid_Login" although X-DocuSign-Authentication is set, and valid email id of admin is provided.
I did noticed that this method is reserved by DocuSign based on this link
The rest API /users is working fine, but I still need equivalent SOAP API.
you are correct. this is one of these things that can only be done using the REST API.
The SOAP API is not currently supported. Meaning, we won't add features or make modifications to it. I highly recommend to use the REST API. If you already have a SOAP Application, you can use the REST API for newer features.

API Gateway Is it possible to set a custom domain name for API Gateway and integrate it with a new CloudFront?

My API endpoint type is edge-optimized. I have a custom domain name API like www.example.com and I want to add a new CloudFront which to block specific countries request in front of my API Gateway.
How to add a new CloudFront in front of my API Gateway and use the same domain name (www.example.com)? I am confused. Is it possible to do that?
Any advice will be appreciated.
Yes it is possible to do that. You should follow the following steps.
Create a origin for your API Gateway inside your CloudFront
distribution. There you should enter the endpoint of your API Gateway
for the origin domain name.
Then you need to create a behavior inside
the CloudFront distribution which forwards requests that match a
specific path pattern to your API Gateway. (Make sure that you put
the Minimum TTL to as 0, since we don't want to cache the the API
requests)
See the following documentation for further reference.
Custom origins
Cache behaviors

Querying SalesForce DB Records using REST API

I have tried implementing like this to get data from SalesForce DB using the REST api,
uri= ...."/query?q=Select+Acc_Name__c+From+Account__c+where+Acc_ID__c+=+'123456'+Limit+5
HttpGet httpGet = new HttpGet(uri);
This is the syntax i found in here
URI
/vXX.X/query/?q=SOQL query
while this works, I don't really want to expose my query like this in uri, Is there an another efficient way to achieve the same operation using REST api ?
You can't modify the way the REST API works. You can implement your own methods via an Apex Restful Web Service. This would allow you to define a method that receives the querystring via a POST (you could even encrypt it first if you wanted to).
Exposing Apex Classes as RESTful Web Services

How can I call non rest api just like rest api?

We're using MVC request in JSP. And now we want to use those request as REST API for some other purpose. Is there any way we can call those Non REST API as REST API?
For example we make ajax post request on an spring-mvc api with some parameters, so we get result accordingly. But I want to use that API as REST like to make requests and responses like REST.