Has anyone managed to create a custom integration between Zapier and Xero by using the 'Webhooks by Zapier' option and a private connection on the Xero side?
At the moment Xero uses Oauth-1a to create sessions and I can't figure out how to even approach this.
I know Zapier has a normal integration with Xero, however I am interested in doing something which isn't available in their integration (create manual journals) and for this I need to figure out how to do the connection manually.
Thanks
Have you taken a look at Xero's Private Application Auth documentation? The private key you create becomes your Consumer Key for API calls. Unfortunately, from there, you do need to do a little coding to support Oauth1 in Zapier.
You have two options:
You could use a serverless function platform like Google Cloud Funtions or AWS Lambda to host your code and use one of Xero's SDKs (like pyxero). You then use a webhook step in Zapier to call the function.
This option is the most robust since and avoids Zapier code limits
You can use a Zapier code step to place the call. In order to do this, you will need to create your own Oauth1 header for your call. You can look at the post HERE by Eliot Muir.
You'll see on lines 32-34 of his example output the headers that need to be included. He has done the hard work of crafting them so you would just need to pull the relevant code and strategy.
This is the most streamlined solution, but you do have to deal with Zapier's lack of 3rd-party packages and a 10-second timeout
Related
I really hope you can help me. I have a project to create an app. I will use Power apps, Python and JavaScript. I need to be in it, because I am not. So my first step is create an API, I have decided to use Azure Function I can explain why. It helps connect my Power Apps(frontend, where i am going to use JavaScript) to backend(Python).
So I have absolutely nothing and I have decided to create an API with Azure Functions, the truth is i dont really know how it works. I can connect it with VScode, but the main question how to create own API? I dont need to pay for servis because I have an Azure Functions which is paid. But I dont really understand how API has too look. I have find a lot information but i cant connect it with what I need.
I need to write my own code for API? Like from empty file? Can do it in VS code and connect it with Azure Functions? What has to be in API I mean my own piece of code or something another? Have anyone created his own API in Azure Functions?
thank you for answering my stupid questions
You can create the Http Trigger in Azure Function if your own API works on HTTP protocol and modify the default Http Trigger API Code according to your requirement.
If your API contains 3rd party APIs, you can create the Http client inside the function code for sending HTTP requests on to the available 3rd party APIs in your function code.
There are plenty of articles on connecting the Azure Functions to Power BI Apps where you can write your own AP code using REST API signature following swagger and add that custom API in Power Apps.
Refer to this article that provides the use case of connect the Azure Function with custom API Code to Power App, given by Carlos Aguilar.
I am trying to develop a simple event-driven Slack bot that uses a user and a bot token to perform some authenticated API calls to Slack's Web API. The bot is functional, except I can't figure out how to use Bolt to store and manage the OAuth tokens after installation. This is my first time using OAuth, so apologies if I am missing anything obvious.
The best guidance I have found on using it is from this link: https://slack.dev/bolt-python/concepts#authenticating-oauth
However, I do not fully understand what an installation_store or state_store is, and more importantly, I am not sure how to access the stored tokens as needed. Furthermore, it seems like this solution relies on local persistence, but Heroku (where I deployed the bot) does not support that. I would prefer a cloud-based solution.
As a result, I decided to build a simple Flask app that handles the installation flow, making the authentication API call and storing the token(s) in a corresponding DynamoDB table. The tokens are stored as key-value pairs, with the key being either the team_id or the user_id, but I don't believe this works if one user uses the bot in multiple workspaces.
Furthermore, I feel like this solution is hacky and unmaintainble. What is the best way to handle the OAuth flow?
I stumbled on this question while trying to figure out the same myself. I can see that slack_sdk does support other installation and state stores like sqllite, aws,... unsure why the same was not carried forward in bolt for python. Having this feature of other stores would be better for security.
So I might suggest using slack_sdk instead of slack_bolt for now?
I've been searching about call an Azure function from CRM using ouath2, all the information that I found is about using function key to call the Azure functions from Dynamics 365.
Please if someone knows, please let me know if ouath2.0 is possible and how I can implement it?
I opened up a github issue to get update from Microsoft on this topic (as I know this is a challenge for a long time), it is still not positive, but may get some feature in near future. Until then we may have to use HttpClient in plugin directly instead of webhook.
This is a known challenge which Web Hooks doesn't even attempt to
address. Your options are limited. So this is a feature request rather
than a documentation issue.
If you attempt to call such an authenticated service using an
HttpClient in a plug-in, you have more options. But none of them today
represent best practices that we would recommend specifically at this
time, although I see people making them work in community posts.
Setting a certificate or secret value within the secure configuration
of the plug-in seems to be the best solution I've seen. But we are
looking to provide something better.
My aim is to select some text from a web page, start a google chrome extension and give the text to a google cloud api (Natural Language API) in my case.
I want to do some sentimental analysis and then get back the result to mark/ highlight positive sentences in green and negative ones in red.
I am new to this and do not know how to start.
The extension consists of manifest, popup etc. How should I call an API from there that does Natural Language Processing?
Should I create a Google Cloud Application with an API_KEY to call? In that case I would have to upload my credentials right?
Sorry sounds a bit confusing I know but I just don't know how I can bring this 2 things together an would be more than happy about any help
The best way to authenticate your app will depend on the specific needs and use cases of your application. You can see an overview of all the different methods here.
If you are not planning on identifying users nor on using a back end server that handles authenticating (as I assume to be your case), the best option would indeed be to use API keys. They do not identify the user, but are enough for the Natural Language APIs.
To do this you will need to create an API key for the services you want and add the necessary restrictions to make the key as secure as possible. Detailed instructions on how to do this and how to use the key in a url can be found here.
The API call could be made from within the Chrome extension with any JavaScript method capable of performing POST requests. For example using XMLHttpRequest or the Fetch API. You can find an example of the parameters that need to be included in the request here.
You may run into CORS issues when making the request directly from the extension. I recommend reading this answer, where a couple of workarounds for these issues are suggested.
While Zapier is very powerful at putting glue between various APIs, I stumbled upon the use case of creating Zaps programmatically, which would offer even more flexibility.
I did some investigation and it appears that Zapier, to this date, does not provide a public API for doing so. Is there any workaround for that ?
Not currently. Creating a zap involves a lot of UI steps (6 or 7) - many of which depend on choices made in each previous step, so trying to do all that through a remote script might be difficult and messy. Maybe share some ideas on your specific use-case: why do you need to create a zap programmatically?
Keep in mind you can also create private apps on Zapier so if there is specific functionality you need to use with Zapier you can do that without exposing it to the world.
The year 2017 Zapier introduced their Command Line Interface, which makes possible building your app programatically via JavaScript.
You can take a look at the Example Apps as well as the CLI-docs.