Azure APIM - how to publish versions - azure-api-management

how to publish latest version to Azure APIM.
With each build/release, I'm looking to publish latest API definitions to APIM, but not sure how to do this.
Found below documentation, but below URL doesn't indicate where to mention serice URL to get the latest API definitions.
PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/api-version-sets/api1?api-version=2018-06-01-preview
If-Match: *
Do I need to add a step in release definition or any other approach like azure function.

Ultimately you have to have an updated OpenAPI spec for your backend with each release. Then you'll be able to import this spec into APIM as a part of your release routine. If you do not maintain OpneAPI spec - there are tools that allow you to generate it from your server-side code.
I would imagine you should be more interested in PUT call rather than PATCH. Since it is likely that with every release you'd want to replace your API in APIM with new one.

Related

How are rest api created using swagger distributed

I understand that creation of Rest api documentation using swagger Ui generates a few jsons
Do other developers need to use swagger UI installation on their laptop to view these ?
What is the best way to view such a documentation
The general way is to host your own swagger ui instance on your servers, exposing the REST documentation. When all fails, and assuming you've enabled CORS, you can use the online petstore and paste the URL to you Swagger there.

Box SDK Api to Delete (all but current versions) of a file

I basically want to delete all versions except for the currently designated version of the file.
For that I am using
BoxClient.getFilesManager().getFileVersions(_fileId, reqObj);
The first entry in the returned List<BoxFileVersion> object is the current version.
There doesn't seem to be any API in the Box SDK (for Java) to delete a version - is this being planned soon ?
Is there a better way ?
The SDK is open-sourced on github. If you feel like it, you can submit a pull request with your change to add in version delete. How to do it is documented in the API documentation.

Difference between comment.Patch and comment.Update in Google Drive API

I went through method documentations both patch and update and it looks they both doing the same.
And i also note that the patch doesn't required the content of the patching comment even though its required to call the patch() method.
So, is the difference between comment.patch() and the comment.update() methods in Google Drive API?
PS : I'm using Google-Drive Java SDK for my implementation.
Thanks.
Patch is used to perform partial updates and save some bandwidth when, for instance, you only want to update a single field in a resource.
For more details about how patch work and for other performance tips, please check the Google Drive SDK documentation:
https://developers.google.com/drive/performance#patch

Google Drive Java Authentication

I am trying to fetch access token and refresh token using the document specified here. While doing so, I am faced with an issue:
java.lang.NoSuchMethodError: com.google.api.client.json.JsonFactory.fromInputStream(Ljava/io/InputStream;Ljava/lang/Class;)
Where can I find the jar which contains this class and method?
The Google Drive Java client library is based on the Google APIs Java client library. Make sure you download it as well. The zip contains the library and all its dependencies.
Also make sure that you don't have conflicting versions of the Google Apis Client library in your compile/classpath as this method is only available in later versions.

Why can't I use SimpleGeo through a URL?

So, Google Places API allows me to receive JSON data through a Google Places API search using a simple:
"https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=50&client=clientId&sensor=true_or_false&signature=SIGNATURE"
(note, includes signature/key).
Why does SimpleGeo not allow this same feature? Is it possible? What is the purpose of all of this server side code that SimpleGeo uses?
Regards,
Ryan
SimpleGeo has recently announced a JavaScript SDK, which includes a JSONP API. This should allow you to do exactly what you're asking -- requesting read-only information from their Context and Places APIs purely from the client side with a simple key to authenticate the request.
I think there are still plenty of purposes for accessing SimpleGeo's data from a server-side application -- not all developers are writing purely JavaScript client-side applications -- but I agree that this new SDK will help a lot of developers.
Also, if you're looking for straightforward REST access to JSON resources without any client libraries, that's also present. See SimpleGeo's documentation on API endpoints.