Add custom methods and custom endpoints in SuiteCRM REST API V8 - sugarcrm

SuiteCRM version: Version 7.10.11
Sugar Version 6.5.25 (Build 344)
I am trying to add custom endpoints in REST API V8. I follow below suitecrm documentation.
https://docs.suitecrm.com/developer/api/version-8/customization/
but its not working. seems like bugs in documentation and there is no sample code available in documentation.
I have check API code file and custom endpoint path is.
// Load Custom Routes
$customRouteFiles = (array) glob($paths->getCustomLibraryPath() . '/API/v8/route/*.php');
I have create custom endpoints in "/API/v8/route/" file but its not working.
I have check documentation available for API 4_1 to add custom API method. but not available for V8 version.
https://docs.suitecrm.com/developer/api/api-4_1/#_adding_custom_api_methods
Anyone Please Suggest latest documentation links or sample code for extending endpoints and adding Custom Rest Methods in V8 . Its very difficult to understand core API code without Proper documentation.
Thanks

Related

How to set a category in Sendgrid-Ruby v3?

Upgrading to SendGrid-Ruby V3 from V2.
In the past we set a category via
header = Smtpapi::Header.new
header.add_category("Congrats Credit")
I have searched the documentation for setting a category, but cannot find anything for V3. There is a reference where you can add 'categories' if you write your own JSON object, but want to use the API without writing my own JSON object.
First, it's important to note that the Sendgrid-Ruby v3 is not using SMTP, it's using the HTTP API.
The answer to your question depends on if you're using the helper class or not. SendGrid has 'kitchen sink' examples for both.

OpenAPI (aka Swagger) in Azure Functions V2

I'm creating a V2 Function App and want to use Swagger/Open API for docs, however it is not yet supported in the Azure Portal for V2 Functions.
Any suggestions on how I can use Swagger with V2 Functions in VSTS to create the docs on each build?
TL;DR - Use the NuGet package to render Open API document and Swagger UI through Azure Functions.
UPDATE (2021-06-04)
Microsoft recently announced the OpenAPI support on Azure Functions during the //Build event.
The Aliencube extension has now been archived and no longer supported. Please use this official extension.
As of today, it's in preview. Although it's in preview, it has more features than the Aliencube one.
Acknowledgement 2: I am still maintaining the official one.
Microsoft hasn’t officially started supporting Open API (or Swagger) yet. But there is a community-driven NuGet package currently available:
Nuget > Aliencube.AzureFunctions.Extensions.OpenApi
And here’s the blog post for it:
Introducing Swagger UI on Azure Functions
Basically its usage is similar to Swashbuckle — using decorators. And it supports both Azure Functions V1 and V2.
Acknowledgement 1: I am the owner of the NuGet package.
For anyone looking into this, Microsoft still hasn't added Open API support for Azure Functions +v2 and there hasn't been any major movement toward it.
I faced this same issue recently and I found a pretty good solution.
If you aren't aware yet, check this out: https://github.com/RicoSuter/NSwag
NSwag is a toolchain that integrates with .NET to produce the Open API documentation and UI, but also generates the respective API clients for you.
I've used this tool for the past 2 years when working with Angular and .NET apps, it saves a lot of time and seamlessly integrates with my whole development workflow.
For Azure Functions +v2, a contributor created a generator that in less than 10 lines of code, allow us to expose the Swagger endpoint for an Azure Function class:
https://github.com/Jusas/NSwag.AzureFunctionsV2
Now, if you design HTTP-Triggered Functions using DI, grouping related operations under the same class and leveraging model binding, you might not even need to apply any custom decorator, it just works!
Here's an example of how one real API would look like:
(ignore the base class. It is part of a personal pattern I follow, unrelated to Swagger)
And this is how it looks like using a swagger UI:
There is official library Azure Functions OpenAPI Extension. It is still in preview, but looks great.
Can you drop your V2 Function to run on v1 of the runtime by starting over with a blank function app first?
The MSDN documents for Create an OpenAPI definition for a function (with a date of 11/2018 interestingly enough) example states:
By default, the function app you create uses version 2.x of the
runtime. You must set the runtime version back to 1.x before you
create your function.
But one can't just move the setting to 1:
To pin your function app to the version 1.x runtime, choose ~1 under
Runtime version. This switch is disabled when you have functions in
your app.
Which implies one must create the Function app, publish/create it, set it to V1 and then put in a function before adding a function app.

Update Template description using Python SDK for Smarsheet API

Asking with hopefulness.
Is there are way to update the Template Description either directly or using the Python SDK?
I'm guessing "no" since the only way to see the Template Description after creation is via the API (can not via the GUI).
-Craig
No, the template endpoints are read-only.

AWS Java SDK (API Gateway): How to disable an API key

Hi I am trying to disable an API key programmatically, but can't find any documentation.
So far I have located 2 classes that might be what I need:
UpdateApiKeyRequest and DeleteApiKeyRequest. Problem is that I have no clue what to do with these.
Please could someone show me how to use these classes to disable or delete an API key?
You can use deleteApiKey API.
The SDK source code is available here. The documentation is available here.
Update:
You can disable an API Key using updateApiKey API.
The SDK is documented here. The API reference is here.
The below is a sample PatchOperations object to be sent in the PATCH request:
{"patchOperations":[{"op":"replace","path":"/enabled","value":"false"}]}

ApiResourceProperty tag can not be compiled to GWT or ignored

We have a GWT app that exposes an API using Google Cloud Endpoints. As we use objectify we can not expose the Key tag to the API. For that we use the ApiResourceProperty in order to make the API ignore the field, but if we do that the GWT compilation fails.
I have tried everything, from using the exclude from source in the gwt.xml to using the #gwtincompatible
So... is there a way to ignore the ApiResourceProperty.class in the GWT compilation?
Any other idea? If not I would have to duplicate my entities for the API
Thanks in advance
The only option I had was to create custom DTOs for the API.