I'm trying to send data out of zapier on FB lead fetch.
is there anyway to do it?
or i must use external php file first?
i need to get name, email and send it to CRM (which is not listed in zapier) my CRM can use URL or XML input. No normal JS API.
Thanks
Zapier has webhooks that let you send data out. Your CRM is then responsible for processing that data (converting it to the right format, etc). You could also add your CRM as a Zapier app that can accept data from your trigger source and perform necessary API calls, updates, etc.
I found
fetch('http://clients.frontask.co.il/WebToLead.aspx&type=get&FirstName='+input.name+'&Email='+input.email+'&Phone='+input.phone+'&lead_from='+input.lead+'&SystemID=UpdateExistingDetails=[1]', { method: 'GET' }).then(function(res) {return res.text();}).then(function(body) {var output = {id: 1234, rawHTML: body};callback(null, output);}).catch(callback);
do the job, but i faced another problem.
because of the system restrictions i cannot use url, i need to send XML file.
Any change I can do it?
thanks
Related
I am using annotator.js to annotate my PDF documents. I am able to save it to my SQL database and retrieve it. But I am not sure how to Bind back the data on to the specific page. I am using Pure HTML, JQuery for the AnnotatorJS API calls and REST web service to send and receive data in JSON format.
My problem is what are the steps required to use the retrieved data from my SQL database and bind it on to the PDF.
Any suggestions?
I had similar problem before. Try this code. You can change your code accordingly
var subscription= $('#content').annotator();
subscription.data('annotator').plugins['Store'].loadAnnotationsFromSearch().then(function(res) {
subscription.annotator('loadAnnotations', res.rows); res.rows /// in my case
});
Could someone explain how I can access Wolfram's API data? I'm not worried about formatting for now--I would just like to learn the basics of interacting with the API.
The Wolfram website FAQ says this: "The Wolfram|Alpha API is designed to operate with interactive web technologies such as AJAX, Flash, and Silverlight."
And the documentation, which is located here: http://products.wolframalpha.com/api/documentation.html, says this: "A simple API call to retrieve output for the query "pi" would look like this:
http://api.wolframalpha.com/v2/query?input=pi&appid=XXXX
This query did not specify a desired output format, and the default is to retrieve the plaintext and image representations of each subpod. The image is returned as an <img> tag suitable for direct inclusion in a web page. Here is the output:"
I just have no idea how to put this together to actually access the Wolfram API data. Do I use AJAX or something else? What is the basic code for accessing the data?
I'm very new at this, so any help would be greatly appreciated. Thanks a lot!!
To use XMLHttpRequest their server must enable credentials by setting the Access-Control-Allow-Credentials response header to “true”
https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
By AJAX I think they mean your server code should make the request.
In the next example they use Java Server Pages on their own domain to make the request:
https://reference.wolfram.com/webMathematica/tutorial/ApplicationsAJAX.html
Check other answers:
Wolfram API javascript cross origin sharing issue
If you use JQuery, a common javasSript framework, you can make an ajax request as follows
var requestData = function() {
$.ajax({
url: "http://api.wolframalpha.com/v2/query?input=pi&appid=XXXX",
}).done(function(data) {
//data should contain the response from wolframalpha
});
I am developing an application that needs to gather information from GitHub, so I began looking at their API. My initial thought was to use the d3.json() function to get the data (because it's simple and has done good things for me in the past), but there doesn't appear to be a way for me to authenticate with that function. For example, $ curl -u "username" https://api.github.com is given as an example of basic authentication (from GitHub API--obviously they use curl for their examples).
So, is there a way to do authentication with the d3.json() function? And if not, what are my other options to get the JSON with JavaScript?
Thanks!
Edit:
I'm experimenting now with using jQuery's getJSON method as shown here, because I started getting the error "XMLHttpRequest cannot load url Origin url is not allowed by Access-Control-Allow-Origin." Of course, the switch doesn't help with the ability to authenticate, but I can at least get the public data (which is most).
Edit #2:
Has anyone experimented with michael/github or fitzgen/github-api? I'm going to start looking into those.
If you have a PHP script which echos JSON, you can do all authentication server-side. Note that you can also send a GET request to your PHP script, so the way you call your script can be dynamic.
I have web application where people can login from twitter and based on their preference and DOM events I need update their status on twitter. I have a good idea how to do this on server side, but for this project I am not using any server side code, So how can I do this by just javascript, #anywhere twitter api and twitter intents are taking me to no where because they prompt user for submitting the tweet which I dont want.
A pure Javascript solution to consume twitter API is not possible without compromising your consumer secret key. Twitter API authenticates every request using a HMAC-SHA1 token, the SHA1 token is generated using the public/private key assigned by twitter to your api account. If you plan to generate this token using a pure javascript SHA1 implementation then it means you will be exposing your private key in the javascript code which anyone can look at.
Even though technically its possible (provided you can find a javascript library which implements SHA1), its not advisable.
FYI, jQuery.Ajax method does let you modify the headers of the ajax request by tapping in to the beforeSend(jqXHR, settings) method.
You should be able to do this with an AJAX POST request to the REST API. Documentation: https://dev.twitter.com/docs/api/1/post/statuses/update
You target the URL http://api.twitter.com/1/statuses/update.format, where format can be either xml or json, and reflects the format of the response. Required data is the status text, and there are several optional parameters which I won't list here. This only works for the currently authenticated user.
An (untested) example using jQuery:
var message = "This is a tweet, there are many like it but this one is mine";
$.ajax({
type: "POST",
url: "http://api.twitter.com/1/statuses/update.json",
data: "status="+message,
datatype: "json"
});
I have a web service that performs a database search. It accepts both GET and POST requests, and can return data in either JSON, CSV, or HTML format based on the HTTP Accept header.
I have a web page that makes an Ajax request to this web service, and displays the search results.
I have been asked to add a button to this page that will allow the user to save the data in CSV format.
Earlier this year, someone was in the same boat, and got the response
You cannot do it using javascript
capabilities, since javascript has no
permission to write on client machine,
instead you can send request to server
to create csv file and send it back to
client.
So I added a button that does
window.open("MyWebService.cgi?" + theSameQueryStringIPassedInTheAjaxCall),
which opens the HTML version in a new browser tab. I want the CSV version. Is there a way I could pass an Accept: text/csv HTTP header? (I know how to do it with XMLHttpRequest and setRequestHeader, but that doesn't help me.)
Don't think so. I think you should use an parameter instead.