I'm trying to learn Azure Cosmos Db. I've read the document.
As far as I see, we can create .Net/NodeJs/Java applications, and get/insert/update data in the Cosmos Db.
However, I'm not clear whether we can make a http request from JavaScript/JQuery/etc..
to fetch data:
does cosmos db provide only .net/java/nodejs/phyton, or we can make a request using any software language?
Thanks in advance.
Cosmos exposes a REST API, so you can access with anything capable of creating HTTP requests. Here’s the API documentation https://learn.microsoft.com/en-us/rest/api/documentdb/
I want to answer my question. I tried to make an http request from Azure Cosmos DB and I did.
There is only one crucial step that you need to create an auth code for each request. You can create the auth code by reading below page
https://learn.microsoft.com/en-us/rest/api/documentdb/access-control-on-documentdb-resources?redirectedfrom=MSDN
This is the detailed document for using Cosmos DB Rest API.
https://learn.microsoft.com/en-us/rest/api/documentdb/restful-interactions-with-documentdb-resources
I hope this would be helpful.
Related
I'm trying to use Azure Data Factory to connect to QuickBooks Online General Ledger using OAUTH2. My approach is to first create a pipeline with a Web Activity to perform a POST call to receive the authentication token, then create a Copy Activity to read a JSON returned from QuickBooks. My approach is based on this blog. from Alex Volok Consultancy.
I have been unable to use the Web Activity successfully. I am unsure of the parameters and how to configure the Web Activity but have tried many different combinations trying to get this to work.
My desired result is to get QuickBooks Online data into Azure, is this the correct approach?
If this is not the best approach, what is?
If this is the correct approach, the attached screenshot shows my attempt at creating the Web Activity parameters to retrieve the authentication token that is currently not working. Any help is appreciated.
Please follow the below approach. It will solve your problem.
Sample URL : http://restapi.adequateshop.com/api/authaccount/login
Postman:
Using Postman, I generated a bearer Token for testing.
I used the same URL with web Activity and generated a bearer Token in the Azure data factory.
Use Your User id and Password as Body.
Output:
For more information refer this SO Thread and Blog by Ashok Patel
I need to query this API: https://docs.art.rmngp.fr/#search I have a react app where I was planning on making HTTP requests to this API but I haven't been able to perform a search. My question is how to go about doing this? Do I need to make a server to query this API? or what the architecture would look like.
How would you query this API https://api.art.rmngp.fr/v1/ with nodejs.
I am trying to use Azure Logic Apps to read data from one of the Salesforce objects which has huge number of records. The Salesforce connector fetches the record and returns the pagination link as #odata.nextLink. But when I try to use a JSON parser to read the value it’s coming as null.
I tried to access the nextlink in a browser but it requires authentication. What authentication do we pass here ?
I would like to use an until action to iterate till I get a next link . So how do I check the condition for the until loop ?
nextLink doesn't look like core Salesforce thing, it might be the OData connector preprocessing the results for you. You'd have to consult the documentation for the connector (if any).
Salesforce's REST API will return field with nextRecordsUrl if there's next page of results, you'd call that in loop until the field disappears. You'd call it like any other REST API resource available after login, by passing Authorization: Bearer <sessionId also known as accessToken here>. Again - probably the connector abstracts this away from you. Don't think you can send headers like that in browser, you'd need curl, Postman, SoapUI or similar http client.
If you don't get better answer and documentation is scarce - consider using raw REST API. Or Azure Data Factory has an almost-decent Salesforce connector?
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_query.htm
I am working with CosmosDB and fetching data, which has a few tokenized fields due to security. The obvious way to handle this is to make a query, get the data from CosmosDB and then de-tokenize it using a REST API.
But I am trying to check if there is a way where in we can use a UDF in Azure CosmosDB and make a REST API call from the UDF Javascript, which so far I am unable to do. If this is possible, I only call the query (with the UDF) and I get de-tokenized data back.
** The de-tokenize process has to happen through a REST API call to external party.
Any help or experience will be appreciated.
Thanks
This is not possible with a UDF or any server-side capability in Cosmos. The security implications for this is why it's not allowed/possible.
You'll need to read the data into your app, then make the REST call before passing down to the user.
Thanks.
MS Dynamics 365 has exposed two REST APIs in order to get to the data. The first API is an URL that returns a token. I need to dynamically pass the token as header to the second REST API and pull the actual data. Can we use Logic Apps or Azure data factory to accomplish this? If yes, can you please provide the steps to accomplish this? Any help will be much appreciated. Thanks in advance.
Logic Apps has a native connector to the D365 Common Data Service, and it can be triggered using a REST call, so it could in effect replace the need for the native REST API, but it would not be my first choice because it will add some overhead (delay) to your round-trip depending on whether the Logic App has been used lately.