How to customize the payload with additional details in webhook integration? - integration

I have a setup in which Dynatrace is monitoring my host and application. Further, it is integrated with PagerDuty in which the incidents are generated. I have integrated them using the custom webhook integration and currently am using the available placeholders. Now, my problem is that I want to use some custom alerts other than the placeholder or any plain text. Also, suppose we get a JSON for a particular placeholder, can we use a part of it and not entirely as we sometimes need only a part of that entire JSON?
Thanks in advance.

Related

How to test WebHooks without an on-premise external system?

I'm trying to teach myself about integrating systems via WebHooks.
In a free/hosted GIS system, I can create a WebHook that would, in theory, POST a JSON object to an external system.
The problem is, I don't have an external system that's available right now for for receiving the POST.
I think I need some sort of publicly available sample server that would:
Receive the POST requests
Do something with the requests (ie. create some sort of record)
...so that I could determine if the WebHook worked correctly or not.
How can I test my WebHooks without having an on-premise external system?
I've poked around websites like Postman Echo and Amazon Lambda. But to my untrained eye, it seems like they're not quite designed for what I need.
You could use any of these options depending on your requirements:
You could use webhooks modules in services like Integromat or Zapier to receive webhook data and then apply transformation.
You could deploy a script on heroku and use the URL generated there to send the webhooks calls.
You could also use services like requestbin, webhook.site etc if you just want to receive webhooks data.
Regards

How to send alerts in APIC Test and Monitor?

On the introduction page for the 'APIC Test and Monitor tool' one of the listed features is 'Get alerts on your API Health'. However once inside the tool I can't find any reference on how to generate alerts...
Is it already possibble? Or just an idea for the future?
Great question, thank you for asking. You are absolutely right, we are working on shipping notification/alerts as a pluggable ecosystem. We are building a fully featured API and Webhooks, any platform that leverages an API can be used, as well as email and SMS.
Out of the box we will provide the most popular plugins such as the following:
Slack
BigPanda
HipChat
StatusPage.io
JIRA
Twilio
DataDog
New Relic
Elastic
You will also be able to create alert groups, ex. specific tests/monitoring can be mapped to specific groups.
Will update this space when it becomes available. Your feedback is helpful, what is your preferred method to be notified by?
Thanks!

Link a website (kraken.com) using API on Android Studio

I was wondering how I could link my application to kraken.com server.
For example, making a login activity that sends the username and password to the server and if it's correct, open another activity.
The kraken's API is given by the following link: https://www.kraken.com/help/api
The problem is that I don't know how this API exactly works. How can I make HTTP Request and what is json? Consider I'm new in this area (API).
So firstly, JSON stand for Javascript Object Notation, it's a syntax for exchanging or storing data.
I'm assuming you're using Java since you're using Android Studio.
Looking at Kraken's API page: https://www.kraken.com/help/api#example-api-code
They don't currently have support a 3rd party Java Library for API access. So you would be looking a using a RESTful approach.
Here is an example of how to use that approach in Java: https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/

How to make basic REST API calls using a browser

I am trying to get started with REST API calls by seeing how to format the API calls using a browser. Most examples I have found online use SDKs or just return all fields for a request.
For example, I am trying to use the Soundcloud API to view track information.
To start, I've made a simple request in the browser as follows http://api.soundcloud.com/tracks/13158665.json?client_id=31a9f4a3314c219bd5c79393a8a569ec which returns a bunch of info about the track in JSON format
(e.g. {"kind":"track","id":13158665,"created_at":"2011/04/06 15:37:43 ...})
Is it possible to only to get returned the "created_at" value using the browser? I apologize if this question is basic, but I don't know what keywords to search online. Links to basic guides would be nice, although I would prefer to stay out of using a specific SDK for the time being.
In fact, it's really hard to answer such question since it depends on the Web APIs. I mean if the API supports to return only a subset of fields, you could but if not, you will receive all the content. From what I saw on the documentation, it's not possible. The filters only allow you to get a subset of elements and not control the list of returned fields within elements.
Notice that you have a great application to execute HTTP requests (and also REST) in Chrome: Postman. This allows to execute all HTTP methods and not only GET ones and controls the headers and sent content and also see what is received back.
If you use Firefox, Firebug provides a similar thing.
To finish, you could have a look at this link to find out hints about the way Web APIs work and are designed: https://templth.wordpress.com/2014/12/15/designing-a-web-api/.
Hope it helps you and I answered you question,
Thierry
Straight from the browser bar you can utilize REST endpoints that respond to a GET message. That is what you are doing when you hit that URI, you are sending an HTTP GET message to that server and it is sending back a JSON.
You are not always guaranteed a JSON, or anything when hitting a known REST endpoint. What each endpoint returns when hit with a GET is specific to how it was built. In that case, it is built to return a JSON, but some may return an HTML page. In my personal experience, most endpoints that utilize JSON returns expect you to process that object in a computer fashion and don't give you a lot of options to get a specific field of the JSON. Here is a good link on how to process JSON utilizing JavaScript.
You can utilize REST clients (such as the Advanced REST Client for Chrome) to craft HTTP POST and PUT if a specific REST endpoint has the functionality built in to receive data and do something with it. For example, a lot of wiki style REST endpoints will allow you to create a page with a specifically crafted HTTP POST with either specific header information, URI parameters or a JSON as part of it.
you can install DHC client app in your chrome and send request like put or get

Use curl instead of browser to get auth_token

Looking at: http://developers.box.com/get-started/#authenticating on step #2 I'm trying to use curl to enter the credentials (user/email/password) to get the auth_token. I'd rather do it this way instead of directing the user to their browser because I'm making a script for syncing.
Anyone have an idea how I can do this? can I just do a POST with curl? I'm using v2 of the API.
You must send the user through the web page, unfortunately. However, since you are writing a script, you should also be aware that auth_tokens under the current system, so you can manually retrieve one and include it in your script.
Just one thing to note. If you don't use the standard authentication flow that goes through the Box web ui, then Box's large customers that have all their users sign-on with SSO (Active Directory and similar) logins, won't be your customers.
So, basically, if you want your app to be picked up by enterprise-level customers, then follow the building guidelines that Box provides.