Test/Sandbox Environment for Google My Business API - google-my-business-api

I just started with using Google My Business API and was able to perform the get operations just to verify that my Oauth setup is right. Now I want to add a location using the post method for GMB Add location API but before I push my code to production I want to test out this request. Do we have any testing/sandbox environment for Google My Business API testing ?

For anyone coming here for reference I guess if you are using third party tools(Integromat/ Zapier) to make the API Call, the best way is to validate your request by passing in query parameter: validateOnly = True

According to their doc, this is not possible. please read more here

Related

How to forward an email and change the subject using the Microsoft Graph api

recently I ran into a problem where I was using python imap to automate outlook tasks, but microsft changed basic auth to Oauth now, and I have not being able to authenticate ever since, I get an error
imaplib.error: AUTHENTICATE failed.
So I started working with the Microsoft graph API, in which I can get the information that I need but once I need to forward an email I can't setup a custom subject, I can just add a comment and toRecepient custom arguments.
https://learn.microsoft.com/en-us/graph/api/message-forward?view=graph-rest-1.0&tabs=http
any advice here ?
If you use the Create-Forward endpoint https://learn.microsoft.com/en-us/graph/api/message-createforward that will create a draft message of the forward which you can then patch any message property you want to update and then send.
The one thing they don't mention in the documentation is you should set the Prefer: outlook.timezone header to make sure the dates in you response are set the local time of the responder.

How to authorize a request from Power Automate Desktop to Dataverse?

I'm looking for some advice about authorization for a request I'm making in Power Automate Desktop using the action 'Invoke Web Service'. I'm using this request to get information from Dataverse.
I've currently set up this request using OAuth2.0 with the Grant Type set to Implicit and I've hardcoded a token value into the header. I'm pretty green when it comes to authorization, so I'm just wondering if that's the best way to use OAuth2.0 to get info from Dataverse to PAD? I'm also concerned this token will expire and how to go about handling that. If I should set this up differently please let me know. And if you know how I can refresh the token automatically somehow, advice would be great.
I'm going to make the assumption that you have an Azure instance within your org.
You should be able to execute the entire OAuth flow through PAD given you can do it through Postman ...
https://learn.microsoft.com/en-us/powerapps/developer/data-platform/webapi/use-postman-web-api
... having said that, if you want an easier way, my suggestion would be to use LogicApps as it does all of the hard work for you. It will also protect keys, etc. that run the risk of being exposed if contained within a PAD flow and that's even if your store that sort of information in a KeyVault or something. At some point, it needs to be exposed to PAD.
You can create a LogicApp that's triggered by an incoming HTTP request ...
... and have your DataVerse connector pull the relevant data ...
... to then return back to the calling PAD flow with a response action.
This is an example flow ...
I haven't gone into detail given your question lacks specifics around filtering, etc. but you can always make your LogicApp more comprehensive by adding functionality in the payload to order, filter, expand, etc. on the OData call to DataVerse so you get exactly what you want from a data perspective.

Trying to get detailed data dumps from new google nest e thermostat

I bought a nest thermostat as I thought it would be able to give me detailed data to showing the target temp and the actual as well as time etc. I needed this for various reasons.
However, it seems the official API "Works with Nest" was closed by Google. I've been able to get postman to ping the same location that the Google Nest Webapp hits and get back the data I need. I want to create a simple webapp to keep polling and save the data locally. However, I'm unable to find the OAuth Client Secret that the Nest Webapp uses to get the authorization code. I had to login via the webapp to get the code in one of the request and then test it out using postman.
Is there any other API that will allow my to poll this data for my Nest easier?
If there isn't another API, is there a way to get the Client ID and Client Secret form the Nest Webapp so I can drop that in mine to use? (I know its hacky, but am I think I'm out of options)

Consuming webhooks shopify-api

I'm in the process of building my first RoR webapp and I'm currently trying to set up an integration with Shopify. I want to create an order in my web application whenever one is created in Shopify. For this I want to use a Shopify webhook. Step two will be to set it up so that after processing the order I'll use the Shopify API to update some records. For now my main concern is receiving the webhooks. I've been looking at the documentation for the Shopify gem but with my limited RoR skills I can't seem to figure it out. I've been searching the web for a few hours but can't find any clear examples / explanation.
I'm confused about this gem; shopify-api (https://docs.shopify.com/api/authentication/using-api-gem-with-private-app-credentials). I've created a private app in shopify, but after that I'm lost. Where am I supposed to place this code and how is this invoked after receiving a webhook?
It seems to me that this gem is mainly used to access the Shopify API instead of consuming webhooks. Am I going at this all wrong?
For receiving the changes (especially Order Creation event) from Shopify, you don't need to use any gem or third party to integrate!
Here are the steps that I did before in my app:
1. Provide an api in your app to receive a webhook event
Here is an example:
Your route:
post '/shopify/create_order', to: 'shopify#create_order'
Your controller:
class ShopifyController < ApplicationController
def create_order
# process shopify order here: all info in `params`
end
end
2. Config to call webhook from your Shopify Settings. The configured url will be:
http://your_production_url/shopify/create_order
If you want to test from localhost, go to step 3
3. (Optional) Test from your localhost
Download this free tool: ngrok and extract it to your machine.
Run ngrok in your terminal to generate a forwarding url to your localhost by this command:
ngrok http 3000
So you will get the output from console like this:
Copy the generated url (http://fbc5cf88.ngrok.io for example) above and add to your Shopify settings in step 2
4. (Optional but critical) Set privacy in your app, to make sure only Shopify can call your api. Follow this documentation
Shopify also provides api to integrate with Shopify resources: create/update product, collection, collect, metafield,... You can directly use it. All was described at Shopify API documentation. But the easiest way to work with Shopify is shopify_api gem which provides an interface to work with Shopify (via ActiceResource)
Probably reading up on the documentation on Webhooks would help you figure out a lot of what you need to do
In essence, here are the overview of what you need to start consuming web hooks:
1. Create your web hooks
You can do it using the Shopify API (POST /admin/webhooks.json)
Or you can do it through store admin
The params that you need to take note of:
topic: the type of hook you want (for e.g orders/create)
address: the URL of the endpoint that you would be consuming the hook at (for e.g: https://myapp.domain.com/hooks/order_create)
2. Create your endpoint that will respond to hooks
You then need to setup your ROR app to expose an endpoint that will respond to a POST request.
This endpoint is the same URL that you previously specified when creating the hook
More info at https://docs.shopify.com/api/webhooks/using-webhooks#respond-to-webhook
Notes: You also need to implement a way to verify that requests that you receive through the endpoints came from Shopify, detailed here.

Twitter api request

I have read the documentation of twitter , and created an app and have all the keys needed .
Now i am trying to understand that simple one line http request ,to get a user latest twits .
I have read this Simplest PHP example for retrieving user_timeline with Twitter API version 1.1
but there is not one line code in there to make the request ( i don't know java script).
so , i have this :
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2
Which will not work because my keys should be in this line, but i don't understand how to add them?? where and how i add my keys to this ?
This url is like a node or address so twitter server knows what kind of request you need.
https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi&count=2
Beside url you can pass many other parameter using http header, which is best to be used with server langunge programming, e.g PHP.
In PHP you can pass your credentials by changing header. While current twitter API are using Oauth, it's going to difficult to learn using Oauth this way, the easiest option is to use others' library. Check out 'twitter API library' (just google it)

Resources