Creating a time-driven trigger using REST API - google-api

I was thinking to write some Java code for installing a time driven trigger (to run a google apps script periodically) for an user. But could not find REST API for manipulating triggers. Wanted to know whether it is possible yet. Thank you.
Sanjay

There is no REST API to manipulate triggers. However, you can write a doPost function in your script, publish it as a web app and do a POST from your Java code.
Of course, inside your doPost() function you have to set up a trigger using the ScriptApp API.

Related

How can I wrap an existing REST API into graphQL API using AWS appsync?

I am trying to convert my REST API into graphql using AWS app sync, the problem is I am unable to fine the right method or documentation on how to do it.
I have successfully created a schema, I am trying to give a resolver for it, but I am not sure what is the right way to do it.
The problem was the creation of a pipeline, I changed actions > update runtime > Unit Resolver (VTL only). and then selecting the HTTP request as a data source was open for me to use. the document does not seem to have this information, anyways if you play with it for some time, you can get it (quite frustrating, ngl).

Is there a API for developres for register cast apps?

Hello there i'm in a situation where i need to register a lot of new cast apps and i'm wondering if there is any API to do this task instead of doing it manually one by one on the SDK Developer Console as the docs suggest. I already created one Cast app that is working correctly so i'm familiarized with this console. But i haven't been able to find any documentation regarding some API to make this proccess more automated.
We do not have bulk registrations.

Trigger PubSub messages on Google Sheets save actions

I am trying to automate a Google Sheet import as soon as someone has committed their changes to Google Sheet's version control (and not just edited any cell like the onEdit event seems to trigger, I need it committed).
While polling is an option, I'd rather really have Google Sheets send out a message to PubSub. Now PubSub requires the authentication JSON and such and I haven't seen any integration with Google Sheets that integrates this concept, which surprised me.
I searched on the internet for triggers in Google Sheet and some way to automate code to connect to external resources. Apparently, the Google Drive Push Notification API seems to be the way to go. I'd really like to keep everything in my Google Cloud space so I went for a Google Cloud Function with an HTTP(S) endpoint. I already started working out the Function and PubSub channel when I went back to the documentation to read up on how to send a call to the HTTP endpoint.
Bad luck. Seems you need to register the domain to prove you own it and wishing I could, I can not prove that I own cloudfunctions.net. So there went my plan.
It seems very not-Google like to not integrate its Cloud SDK on Google Sheets triggers since they do offer a Sheets API using Cloud Service Accounts.
So my conclusion is I have two options:
1) I am able to send an HTTP callback on a onEdit() function but only if it's my own domain and I seem to require to set up an environment just for that.
2) I would have to poll the last version of the Google Sheets commit compared to the latest version to trigger it myself.
Am I overlooking something very simple or are these my only options?
Cloud functions count as an AppEngine Standard Endpoint as described here and here, and so do not require domain verification. You can use a cloud function using a Cloud Pub/Sub trigger freely- you don't even need to explicitly set up a subscription.
Edit: I didn't understand the OPs question correctly, they want to prove their ownership of a cloud function to the Google Drive Push Notification API, not Cloud Pub/Sub push. This should be possible through HTML tag verification as described here. In whatever framework you are using for your web server, you should be able to set the appropriate HTML meta tag on the response.

Advantages of using APIs wrapped with .NET in Xamarin

Around a year ago I made an iOS application that finds restaurants near your location of any type and displays information about them. I made a web service call using the FourSquare api to get all the data which was returned in json format and then I parsed it and displayed the information on the UI of the app. Now I want to make an android application using Xamarin.Android since I am learning working with Xamarin studios and C#. When I make a Xamarin.Android application and go to packages then add packages I see there is a Foursquare api package that has a .NET wrapper around it. Here is the website url:
https://www.nuget.org/packages/Foursquare.Api/
So my question is how does this work? Does adding this package mean I don't have to make a web serivce call anymore, instead all the data is stored inside this package and I just have to get all the data the same way I get information from a local database? What are the advantages of using this package instead of just making a web service call to Foursquare?
Think of it this way:
This Foursquare API is simply a .NET wrapper of the web service that you want to use. Thus, somebody has gone ahead and done all of the hard work for you so you can simply consume the returned data in your applications.
What does this mean for you?
Well it means that you don't have to write any REST consumption code and you can focus more on the actual application and any business logic that you need to implement based on the Foursquare objects.
To not confuse any further, this data would come the same way as if you wrote your own web service to access the data from the Foursquare API endpoint.
Advantages:
Already written for you
You don't need to know your way around their REST API
Usually follows best practices per language so it's easy to consume (Objects created, methods, etc)
Disadvantages:
REST endpoint might be updated and not reflect in the package until it's updated
Any bugs/issues in the framework can be hard to workaround if the project is not open source
Could be a lack of documentation on how to use the wrapper

How to void a payment in netsuite using netsuite webservice

I need to void a payment made in netsuite by using NetSuite webservice. Is it possible? I have tried by adding Journal entry for the payment which i need to void. But it doesn't work for me. Any help on this is appreciated.
If you're using suite scripts you can use
nlapiVoidTransaction(transactionType, recordId);
This API is supported in the following script types:
Client
User Event
Scheduled
Suitelet
RESTlet
Workflow Action
The Governance on this API is 10.
The general rule in Netsuite webservice is, if it can be done in the user-interface then it can be done via webservices.
By voiding you mean, deleting the payment? If you can confirm that it is possible do to it (no other child records attach on it, etc.) then it can be done via webservices.
Voiding is not supported via web services or SuiteScript.

Resources