I am using IFTTT.com and on their webhooks page it says
With an optional JSON body of:
{ "value1" : "", "value2" : "", "value3" : "" }
This works fine when I use curl.. however, for my application I can only call a single url. Does anyone know if this is possible in the format like;
https://maker.ifttt.com/trigger/<keyword>/with/key/<key>/value1=blah&value2=blah
I hope this helps.
I wanted to send 3 values via a single url and this is what worked for me.
https://maker.ifttt.com/trigger/My_web_hook/with/key/My_Key?value1=11&value2=13&value3=17
Post JSON data to IFTTT in single url
I hope this helps.
I wanted to send 3 values via a single url and this is what worked for me.
https://maker.ifttt.com/trigger/My_web_hook/with/key/My_Key?value1=11&value2=13&value3=17
My key was followed by a "?", (you have a "/") and then the values. The data 11,13,17 was received by my "webhook" and passed onto me in an email. This is what I wanted to happen.
This perhaps?
https://maker.ifttt.com/trigger//with/key/?value1=blah&value2=blah
I found help in another page here on Stack Overflow but unable to upvote yet. Look for "How to pass data to IFTTT WebHook?"
Related
I actually try to make a simple pipeline to read JSON Data on a API REST and store it in a database.
I try first with a CopyData acticity.
I set up the linked service, the dataset, etc etc...
I need to call an API with POST Method and a Body's payload.
Everything is set, I launch the pipeline and... the api respond like i don't providethe Body's payload.
Double check it, check it via the generated json :
and in the generated pipeline JSON
...
"source": {
"type": "RestSource",
"httpRequestTimeout": "00:01:40",
"requestInterval": "00.00:00:00.010",
"requestMethod": "POST",
"requestBody": "{ \"startDate\":\"2022-09-01T00:00\", \"endDate\":\"2022-09-01T23:59\"}"
},
...
Because requestBody wait a string type, the double quote are escaped...
Never wanted to work. Nothing to do. API never seems to find the body.
I find the "Web" activity and I decide to give it a quick try.
Same api call,same linked service, same dataset same url, same method, same body payload...
Just a big copy&paste.
And it's work...
So, why Web activity works and not CopyData?
I reopen the generated pipeline's JSON and :
Web Activity:
"body": {
"startDate": "2022-09-01T00:00",
"endDate": "2022-09-01T23:59"
},
Copy Activity:
"requestBody": "{ \"startDate\":\"2022-09-01T00:00\", \"endDate\":\"2022-09-01T23:59\"}"
Seems that Web activity don't request the body type to be a String.
Maybe it's the problem,
Maybe Copy rewrite body "badly" and it's fail.
So,
Do I miss something?
or
Is it a bug?
And how do you do it? (consume API data in adf pipeline)
Cheers,
Mike.
You can use #json('{"startDate":"2022-09-01T00:00","endDate":"2022-09-01T23:59"}') in copy activity body
After using the above dynamic content, my copy activity receives the requestBody as an object. Look at the following image:
https://learn.microsoft.com/en-us/answers/questions/1000566/adf-copydata-amp-rest-api.html?childToView=1001129#answer-1001129
Just miss the additional header : content-type : application/json
...
:)
At the moment I am busy working on something that requires input from a Splunk alert.
However, I am having trouble in discovering what the JSON output for the alert might be. I was wondering if anyone knows a way to predict JSON output accurately.
I know the specifics of the event that gives the alert and, of course, the details for the alert itself.
I am not allowed to share, unfortunately. I have a webhook, but it's not online yet, only reachable from localhost, because security has not been fitted appropriately yet. That's why I can't simply send an alert to test it.
Instead I want to send a curl with 'example' JSON output, but because there needs to be some decryption on that sample output, I would like for it to be quite accurate instead of simply taking a wild guess at it.
Is there anybody who can tell me how to predict the JSON payload?
No need to guess the JSON payload, Splunk publishes the structure of the JSON messages made from webhook alert actions.
See https://docs.splunk.com/Documentation/Splunk/8.0.5/Alert/Webhooks
Example:
{
"result": {
"sourcetype" : "mongod",
"count" : "8"
},
"sid" : "scheduler_admin_search_W2_at_14232356_132",
"results_link" : "http://web.example.local:8000/app/search/#go?sid=scheduler_admin_search_W2_at_14232356_132",
"search_name" : null,
"owner" : "admin",
"app" : "search"
}
If this fixes your problem, take a moment to accept the answer. This can be done by clicking on the check mark beside the answer to toggle it from greyed out to filled in!
I using postman to test my api, and I need to send a PUT request that has a json object and some files. Im sending raw data to test this but I cant seem to figure out how to add a file in there.
PUT request
raw data example:
{
"email": "someone#something.com",
"info": "new account",
"file1" : (some file should be here),
"file2": (some file should be here)
}
You are not supposed to send files AND data in a PUT request, either the body of the request IS a file content, either you use POST to have multiple files of a file with other data.
I honestly can't explain more as I am stucked with the same kind of problem :-)
Could someone help me to understand what a specific example of an API link would look like for the following API?
https://engradesandbox.com/docs/
They show examples in the documentation about what the JSON result/return of an API, but not an actual example of what a call would look like.
I've noticed this with most API's, they show the possible result data, but not the default url syntax. It's so frustrating, because looking through existing restful tutorials isn't very fruitful on the subject either.
How do you know what the actual API call should look like?
That actually does tell you you what to do.
All "calls" will be HTTP POST to the URL specified.
If you click on one of them, it takes you to a page that explains the input data for that method.
For example, see the class-behavior-add function. To call that function, you'd post to the URL they specify (https://api.engradesandbox.com/ as of this posting), and the content of your post would be XML or JSON that contains the fields specified here.
Example post data as JSON:
{
"apitask": "class-behavior-add",
"apikey": "your_api_key",
"ses": "session token id",
"clid": 1234567890,
"stuid": "student ID",
"date": 123456789,
"mark": 12,
"points": 123
}
Example post data as XML:
<engrade>
<apitask>class-behavior-add</apitask>
<apikey>your_api_key</apikey>
<ses>session token id</ses>
<clid>1234567890</clid>
<stuid>student ID</stuid>
<date>123456789</date>
<mark>12</mark>
<points>123</points>
</engrade>
The example on the Brightcove site provides the JSON needed to update tags for a particular video in my library:
{"method":"update_video","params":{"video":{"id":"123456",
"shortDescription":"vidDesc","Name":"vidName","startDate":1392912992000,
"endDate":null,"tags":["tag1","tag2","tag3"]},"token":"someToken.."}}
I've tried this, and it works.
But when I try to post something similar but with an updated reference ID, like this:
{"method":"update_video","params":{"video":{"id":"123456",
"shortDescription":"vidDesc","Name":"vidName","startDate":1392912992000,
"endDate":null,"referenceId":"newReferenceId","token":"someToken.."}}
I get this error back from the service:
{"error": {"name":"MissingJSONError","message":"Could not find JSON-RPC.",
"code":211}, "result": null, "id": null}
I've tried passing it as ref as well - no dice. Does anyone know if it's possible to update this value via any means other than Brightcove's web portal?
Make sure you're sending the JSON as form data rather than in the post body.
e.g. with curl,
curl -F 'json={"method":"update_video","params":{"video":{"id":"123456789","referenceId":"newrefid"},"token":"myToken"}}' https://api.brightcove.com/services/post