Custom API endpoint in extension library - acumatica

We have a custom web service for Acumatica, that we would like to integrate into our extension library. This is a service that accepts data to post into Acumatica (multiple DACs used).
However, I cannot find any information on the proper way to do that.
We use Web API (Api Controller) and route based endpoints, and it is likely that some registration needs to take place when the extension library is loaded.
Any pointers to how this should be done?
b

Related

Selecting custom domain in Azure API Management

I have a shared instance of API Management that has two custom domains associated with it. These two custom domains are:
team1Naming.company.com and team2Naming.company.com
Right now when I create a new API it always defaults to using team1Naming.company.com for all APIs. What I want is for all APIs in team1Product to use team1Naming.company.com as the base url and all APIs in team2Product to use team2Naming.company.com as the base url.
Does anyone know how to set a different base url on certain APIs?

Swashbuckle generated Swagger creates duplicate version path in Azure API Management

I am trying to configure Azure API Management to use versioning and have it work with a Swagger / Open API document generated by Swashbuckle.
I have an API with 2 versions - 1.0 and 2.0. I have configured Swashbuckle to generate 2 seperate Swagger documents, one for each version. All good.
The versioning scheme is by path so consumers need to call the correct path (v1.0 or v2.0). Like so: https://someurl/v1.0/some/thing
I have defined both versions in Azure API Management and imported both documents.
The problem is that Azure API Management is adding the path to the base URL and then because the path that is defined in the Swashbuckle generated Open API document I'm ending up with https://someurl/v1.0/v1.0/some/thing in Azure API Management.
Below is a snippet of the generated Swagger / Open API...
And the API version settings in Azure API Management...
And the full URL in Azure API Management...
So, my questions is how can I generate a Swagger document, using Swashbuckle or any other tool in a way that I can support Azure API Management versioning using the path versioning scheme.
Thank you in advance!
Since OpenAPI specification itself does not allow you to define versioning scheme, it is impossible to infer user intention at APIM level. One may want to import API with /v1.0/ in path as a single API, someone else, like in your case, wants to have API + version set. APIM by default does not create/update version sets during API import, so the only way at the moment is to remove /v1.0 prefixes from OpenAPI spec before you import into APIM.
APIMs domain model allows one to control versioning scheme (path prefix, header name/value, query parameter name/value) at the level of API version set, so that you do not need to duplicate /v1.0 on every operation of your API. By nature of this if your API version set is configured to have path prefix of /v1.0 it will be appended to all API paths included into this version set. And that is what produces the doubling.

Difference between platformwebservices vs ycommercewebservices

What is the ideal scenario to use platformwebservices and ycommercewebservices, and what is the difference between the two.
Platformwebservices
provide secure CRUD access to all models in the service layer over a well understood and widely adopted protocol.
A secured RESTful access to all Hybris models, when you create or update an item the platform web services will generate / update the API for you.It's accessible from '/ws410'. You do not need to change anything within this extension.
Ycommercewebservices
exposes part of the Commerce Facades as REST-based web services, including calls for product search and product details. The focus is to provide a working example of how a REST-based API can be exposed.
First it's a template, as it starts with 'Y' so to create your own you need to run 'ant extgen'. It will provide you RESTful access to few out of the box Facades. Up to you to add more Facades or update the existing one.
for OCC implementations use CommerceWebservices. PlatformWebservices are for doing basic CRUD operations and it completely bypasses the business logic .
So if you want to leverage any hybris provided business logic and don't want to write your own logic for example cart management CommerceWebservices is the recommended way.

Accessing Dynamics CRM 2011 data through a website using only HTML5, JS, and CSS

Looking to create a completely external portal using only HTML5, JS, and CSS to show CRM 2011 data. It does not look like I can use REST or SOAP because they cannot authenticate externally. Does anyone know how I would do this?
Thanks!
To do this, your OrganizationData.svc service would need to be externally accessible, and it would need to function without authentication (or, your authentication would need to happen within your javascript - where the end user would be able to read your source code). Either way is not a wise idea, since all of your data would be visible to the world!
If you are only dealing with internal authenticated users, read up on the oDATA endpoint.
If you want to deal with external and/or unauthenticated users, you'll need to find another way to do this that does all of the data filtering & authorization control you need.
I think we normally achieve this using a intermediary integration service. You could have a service which has access to the Org service through conventional CRM authentication, and which provides a number of methods which can be called anonymously (or by custom security) by client code.
For example, a web page calls the 'int' service's 'getContact' method, passing an email address of the user. The 'int' service validates the user's email address and then retrieves the required data from CRM's org service, using credentials stored in a config file (a CRM user with sufficient permissions to serve the 'int' service's methods). The 'int' service then parses the data and returns it to the client code - which has no knowledge of CRM's existence - perhaps as JSON for usability.

Showing values from a external REST service

I would like to enter a value in a field and retrieve related information from a REST service provider. How should I approach this in an xpage?
For example, typing a product name should be the input for a REST call to the third part provider I alread have access to and get all the relevant information in JSON/XML. I have looked at the REST Control in xpage and not sure how to make it look at a third party URL. It seems to only look at domino objects.
The REST Control from the extension library is to provide a REST service, not consume one. Dojo has methods for consuming a REST service, namely the xhrGet and xhrPost methods. Here's a link to xhrGet. Then use the value from the field you were speaking about to build the URL to your 3rd party REST service.
#Keithstric is right. Use Dojo to read REST from other URLs. You might need to use the Domino Proxy to comply with JavaScript same origin policies.

Resources