Questions in topic: "webhooks" https://knowledge.亚搏在线safe.com/questions/topics/single/19871.html The latest questions for the topic "webhooks" Microsoft Graph Webhook to FME Server Topic https://knowledge.亚搏在线safe.com/questions/86950/microsoft-graph-webhook-to-fme-server-topic.html

I'm trying to get a webhook up and running so that Microsoft Graph can write straight to a topic on one of my FME Cloud instances.I'm using the following:


Go tohttps://developer.microsoft.com/graph/graph-explorer/,do a POST-request tohttps://graph.microsoft.com/v1.0/subscriptionsusing the following body:

{   "changeType": "created,updated",   "notificationUrl": "the-topic-url from Message as Subscriber Content",   "resource": "me/mailFolders('Inbox')/messages",   "expirationDateTime":"2019-02-15T18:23:45.9356913Z",   "fmetoken":"token-goes-here"}


However,I get the following response:


{    "error": {        "code": "InvalidRequest",        "message": "Subscription validation request failed.Must respond with 200 OK to this request.",        "innerError": {            "request-id": "5b842b2b-6325-444e-890e-f9ff6eb61510",            "date": "2019-02-14T13:09:40"        }    }}


Using Postman,I've verified that I get a 202-response if I make a POST-request to the topic URL.Is there another way that I can get a Microsoft Graph webhook up and running?I've seen that there's a web connection for MS Graph,but I don't know if there's any way for me to use that to set up the webhook.

microsoft webhooks Thu,14 Feb 2019 13:36:47 GMT fhilding
Getting Started with FME and the Web https://knowledge.亚搏在线safe.com/articles/1543/getting-started-with-fme-and-the-web.html

FME technology (FME Desktop,FME Server,FME Cloud) is well suited for working with the latest web technologies.Here you will learn about how to work with:


Web Resources

This is the static data on the web such as images,XML,Shapefiles,AutoCAD DWG,GeoJSON,Web Map Tiles,PDF,and the list goes on.Data that users download and that some web applications consume as well.FME can use all these web resources as well as produce them,and even transfer them to where they are served from.

Accessing
In a workspace,all file-based Readers can accessdata from a URLor Web Resources.TheHTTPCallertransformer can also download data with the added option to authenticate the requests.The HTTPCaller can store cookie data for a host,which allows you to login using one URL and then download a resource from another URL.If the data you download is not XML/JSON,which are easily handled by transformers in FME Workbench,you can use theAttributeFileWriterorFeatureWritertransformers to save it locally,then followed by theFeatureReadertransformer to read it back into the workspace.

Providing
Once you have files,you need to serve them.This can be as simple as copying them to the public folder of a website (e.g.usingFile Copy writer) or you might use an existing cloud service for this purpose.FME has native support for bothAmazon S3and Dropbox (DropboxConnector),and you can upload data to other cloud services such as Google Drive andBox.comusing the HTTPCaller transformer.In addition,thePythonCallertransformer can be used to upload data if all else fails.

Note: Many of the latest web services are implementing an authorization framework called OAuth.In FME 2016,you can定义OAuth 2.0 web连接that the HTTPCaller can use when connecting to web services.This provides greater security than regular HTTP and Token authentication methods.

Examples


Web Services

Web services provide the standard for means of communication and grant access to functionality between applications that would otherwise be disconnected.FME technology can be leveraged to use existing web services,create new web services,and implement web service standards.FME Server provides web services for some common data 亚搏在线workflows and can be extended to implement common industry standards.

FME Server REST API

The FME Server REST API is a powerful tool that can be used to interact with FME Server.TheFME Server REST API Trainingteaches users how to use the FME Server REST API and build their own web applications.The REST API allows a user to interact with the FME Server without the use of the FME Server's Graphical User Interface.This courseteaches users what the REST API is,how to use it,and how to build custom web applications that leverage the power of FME.

Accessing
Native Support
There are many,many web services that you may want to access with FME.Generally,these services either store data for use with a set of applications or process data for use by other applications.FME supports both cases using a combination of Readers,Writers and Transformers.

Web service providers that are natively supported by FME include:


Do-It-Yourself Support
The list of supported providers above is quite small when considering the vastness of the web.To support other web services,the HTTPCaller transformer can be utilized to connect and the required protocol logic can be managed into a single interface,called acustom transformer.

Examples of using the HTTPCaller transformer to connect to web services include:

Note: Many of the latest web services are implementing an authorization framework called OAuth.In FME 2016,you can定义OAuth 2.0 web连接that the HTTPCaller can use when connecting to web services.This provides greater security than regular HTTP and Token authentication methods when connecting to web services such as: Google Drive,Dropbox,Box.com,and many more.

Providing
FME provides a great platform for working with data and FME Server provides a web service for directly exposing data called the theData Streaming service.This service can be built upon to implement third-party web standards as well as creating your own RPC or REST bespoke web services.Web services can be created with FME Server,including native support forData DeliveryandData Loading– two very common web data 亚搏在线workflows.

Examples



Webhooks

Webhooks are HTTP (POST,GET) callbacks that are sent to user-defined URLs in response to triggers or events.The use of Webhooks allow for third party data integration with existing services,such as FME Server.Webhooks only need an HTTP URL instead of a specific protocol like JMS or WebSockets.

If your client needs updates for specific events,creating a Webhook for those events will enable them to receive and disseminate information about that event into their automated 亚搏在线workflows.A Webhook allows one system to receive data from another system in real-time.Instead of polling a source system for new data,events in the source system automatically send data to the target system.

Using Webhooks is nearly as simple as entering a URL into the address bar of any web browser.The URLs aren't complicated,usually won't require any configuration,and there is no requirement to write code!

Accessing or Calling a Webhook URL
TheHTTPCallertransformer is the gateway for FME to integrate with Webhooks provided by third parties.Workspaces,authored in FME Workbench,can translate spatial data and construct messages in the syntax required by other services (e.g.XML or JSON).HTTPCaller can use the POST request method to send the message to the Webhook,where it will be consumed by the third party service.

Providing a Webhook URL
FME Server can provide the Webhook callback URL with its Notification Service.Every topic created in FME Serverautomatically generates a direct URL that can be provided as the callback URL of a Webhook.When an event occurs in another system,the topic in FME Server will be provided with information about that event.

As an example,imagine that you have a webpage where users can post data.You could setup the webpage to forward new entries on to other systems via a Webhook.By providing the Webhook callback URL,and when new data is posted the webpage,the HTTP POST method will send the data to your URL,typically as a JSON payload.This information can be digested to trigger 亚搏在线workflows or propagated to other systems using subsequent Webhooks.

Subscriptions can be configured to monitor a topic and thenFME Server can perform additional events,such as delivering data via email or updating a database,based on the protocols you have set up.

Examples



WebSockets

WebSockets are a relatively new technology,implemented on top of HTTP,that allows for bidirectional browser-based client-server communication without the overhead of polling (AJAX requests with HTTP overhead),nor the inconvenience and unreliability of client plugins.Modern browsers include built-in implementations of a JavaScript API for connecting to a WebSockets server.Web applications can use WebSockets to pass information back and forth between server and client to give an always connected,real-time,and immersive feel.

Since the 2014 release,FME Server can act as a WebSocket serverwithout additional modules,allowing fast real-time communication with client web applications,with minimal setup required.

Accessing or Receiving
Using theWebSocketReceivertransformer,FME can receive WebSocket messages from various servers.A feature is produced each time a message is received,and the contents of the message is placed into the specified attribute.FME workspaces containing WebSocketReceiver transformers can be authored to process the messages in the same 亚搏在线workflow to create spatial data or for generating notifications based on data contained in the message.

Messages can also be received by theWebSocket Publisher– part of the FME Server Notification Service.This publisher receives messages over TCP from a WebSocket-supported client and publishes them to FME Server topics.Supported clients can include the WebSocketSender transformer,as well as Java or HTML5 web browsers.

Providing or Sending
TheWebSocketSendertransformer can send messages to WebSocket servers.The first input feature will cause the WebSocketSender to initialize a connection,and features specified in the data to transmit will be sent to the server,including the first feature that initiated the connection,in real-time.

TheWebSocket Subscribercan be used to receive notifications from the FME Server Notification Service and publish them over TCP to WebSocket-supported clients that are connected to the FME Server WebSocket server or another target URL.Supported clients include the WebSocketReceiver transformer and HTML5-based web browsers.

Examples


web cloud websockets cloud services webhooks Thu,25 Aug 2016 19:51:11 GMT MitaAt亚搏在线Safe
Webhooks and FME Server with Slack Integrations (2016) https://knowledge.亚搏在线safe.com/articles/31024/webhooks-and-fme-server-with-slack-integrations-1.html

Downloads

Introduction

There is a huge benefit to using Webhooks as means of instant notification - if your client needs updates for specific events,creating a Webhook for those events will enable them to receive and disseminate information about that event into their automated 亚搏在线workflows.A Webhook allows one system to receive data from another system in real-time.Instead of polling a source system for new data,events in the source system automatically send data to the target system.

Webhooks are HTTP (POST,GET) callbacks that are sent to user-defined URLs in response to triggers or events.The use of Webhooks allow for third party data integration with existing services,such as FME Server!

Using Webhooks is nearly as simple as entering a URL into the address bar of any web browser.The URLs are almost always contained on one line,and there is no requirement to write code!

As an example,imagine that you have a webpage where users can post data.You could setup a Webhook to track new postings.By inserting a URL of your choosing into this Webhook,and when new data is posted,it will use the HTTP POST method to send the data to your URL,typically as a JSON payload.This information can be digested to trigger 亚搏在线workflows or propagated to other systems using subsequent Webhooks.

FME Server Providing a Webhook

Every topic created in FME Server automatically generates a direct URL that can be used with a Webhook.When an event configured to the direct URL triggers,it will send information to that topic in FME Server.Subscriptions can be configured to monitor a topic and then FME Server can perform additional events,such as delivering data via email or updating a database,based on the protocols you have set up.

(Navigate tothis documentationfor information on the supported subscriber protocols in FME Server and how to properly configure each.)

Obtaining the direct URLs to trigger topics from FME Server is really easy:

  • Navigate to Topics in the FME Server Web UI (under Manage > Notifications)
  • Choose any existing topic
  • Select Developer Information to reveal the direct URL

FME Server Sending Notifications to a Webhook

The power of FME Server doesn't stop with enabling third-party apps to send messages to FME Server via Webhooks.In fact,FME Server has the ability to submit data to URLs,which includes Webhooks – this means that FME Server can be used with any third-party services that utilize Webhooks!

In this example,we will be using a rich messaging tool.Through some simple configurations,and without writing any code,FME Server can be configured to send information about successful (or failed) jobs to Slack.This provides an easy and effective way to be informed about and monitor scheduling,automation,or general activity with FME Server.

A workspace can be authored to create and format data to send off to a Webhook.This example workspace pictured below is driven by the HTTPCaller – which is the transformer used to actually submit data to the Webhook.



Below is an example of FME Server sending to a Webhook.In this example,you will:

  • Configure a Slack Webhook URL as the endpoint for delivering a message
  • Publish an example workspace to FME Server designed for automating Slack messages
  • Create and manage notifications in FME Server for the example workspace
  • Publish and run a workspace to trigger the automated messages

Requirements

  • An account withSlackmessaging service

Step 1) Configure the Third-Party Service | Slack

Slack keeps you organized with purposeful channels.This example requires you to setup a channel to use for the purpose of receiving messages sent by a workspace run by FME Server.After creating a new channel,or selecting an existing one,add an "Incoming WebHooks Integration".The channel fme_notifications is used in this example.

  • Slack will then take you to a configuration page where you can select an existing Channel,or create a new one.Click onAdd Incoming WebHooks Integrationto retrieve the Webhook URL.

The URL will look similar tohttps://hooks.slack.com/services/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and will be used as theSlack Webhook URLparameter in the example FME Workspace.

Step 2) Configure the Workspace | FME Desktop

This example workspace has been configured to provide a link to the log file within the Slack message for any failed job.For these links to work,the Token Authentication parameter must be valid (see below for an example).

Slack Webhook URL:

FME Server Hostname: The hostname of your FME Server.

Token Authentication: A valid token can be obtained by selectingManage Tokenin the FME Server Web UI (see image below) or by accessing the REST API of your FME Server via http:// : /fmerest/ and selecting Get Tokenin the upper-right corner.

For more information about the Token Service,please seethis documentation.

Step 3) Publish the Workspace | FME Desktop

Publish the example workspace fmeserver_slack_webhook_2016.fmw to your FME Server.This workspace contains all the logic required for Slack to post a message to a channel.Since this workspace will be configured with the Workspace Subscriber,it does not need to be registered with any FME Server Services.

  • Select an existing repository or create a new one.Do not select "Upload data files".
  • Unselect all Services.When you click Publish to complete this process,the warning message "No services are currently selected." can be 亚搏在线safely ignored.

Step 4) Subscribe Workspace to Topic | FME Server Web UI

In order for the example workspace to send messages to Slack,it needs to subscribe to a topic that will be triggered by other workspaces run in FME Server.The topic will notify the Workspace Subscription configured in this step and pass data to the JSON Reader of the workspace.

  • Create the topic namedSLACK_WEBHOOKusing the FME Server Web UI (Manage > Notifications > Topics).
  • Create a new subscription namedSLACK_TRIGGERusing the FME Server Web UI (Manage > Notifications > Subscriptions).
  • Subscribe to the SLACK_WEBHOOK topic and set the protocol toWorkspace.
  • Select thefmeserver_slack_webhook_2016.fmwworkspace.
  • Set theNotification Message Mappingparameter to point at the JSON Reader.
  • After making this change,the JSON Reader parameter is disabled and the following message is displayed.This ensures the JSON passed by the SLACK_WEBHOOK topic will be directed to the JSON Reader in the example workspace.

Step 5) Configure Workspaces to Post to Topic | FME Desktop

The last step is configuring workspaces to post job status notifications to the topic,and thus messages to your Slack channel.This can be achieved in FME Desktop when publishing another workspace to FME Server.

Two workspaces have been included in this example package to test the Slack messages: simple_success.fmw and simple_fail.fmw.Select the Job Submitter Service,edit the properties andset the Notify on Job Completionto the SLACK_WEBHOOK topic.

Step 6) Verify the Slack Webhook Integration | FME Server Web UI

Run either workspace (simple_success.fmw or simple_fail.fmw) that was just published and registered with the Job Submitter Service.Observe the results in Slack after the job completes.

Testing and Debugging Webhooks

Verifying the Webhook Output

RequestBinprovides a URL that can used in place of the Slack Webhook URL.This service can be used to inspect exactly what FME Server is sending.

Providing Sample Webhook Input

Hurlgenerates HTTP requests that can be directed towards Webhook URLs.Instead of using FME to create and send the JSON message,this tool can be used to send your own message to any third-party service.This is particularly useful for testing scenarios where FME Server is providing the Webhook.

Verifying the Webhook Input

RequestBincan also be used to see what other third-party services are providing.FME Server topic monitoring can show the message,but not all of the HTTP details;RequestBin can be used to further debug each request.

Additional Resources and Information

Blog: Moving Data over the Web: AJAX vs.WebSockets vs.Webhooks

Triggering Notifications from a Workspace

FME Server Developer Playground: Trigger Notification

Webinar: How to Develop for Data Transformation with FME Server

notification service integration slack webhooks Fri,15 Jul 2016 15:22:11 GMT rylanat亚搏在线safe
Webhooks and FME Server with Slack Integrations (2015) https://knowledge.亚搏在线safe.com/articles/19705/webhooks-and-fme-server-with-slack-integrations.html

This article is specific to FME Desktop and Server 2015.1.For the latest version of this content,please visitWebhooks and FME Server with Slack Integrations.

Downloads

Introduction

Webhooks are HTTP (POST,GET) callbacks that are sent to user-defined URLs in response to triggers or events.The use of Webhooks allow for third party data integration with existing services,such as FME Server!


There is a huge benefit to using Webhooks as means of instant notification - if your client is requesting updates for specific events,creating a Webhook for those events will enable them to receive and disseminate information about that event into their automated 亚搏在线workflows.


Using Webhooks is nearly as simple as entering a URL into the address bar of any web browser.The URLs are almost always contained on one line,and there is no requirement to write code!

As an example,imagine that you have a webpage where users can post data.You could setup a Webhook to track new postings.By inserting a URL of your choosing into this Webhook and whenever new data is posted,it will trigger the HTTP POST command and send it to your URL containing information about the new data posting,typically as a JSON payload.This information can be digested to trigger 亚搏在线workflows or perform additional Webhooks.

Webhooks and FME Server

Hooking the Webhook to Topics

Every topic created in FME Server automatically generates a direct URL that can be used with a Webhook.When an event configured to the direct URL triggers,it will send information to that topic in FME Server.If you have any subscriptions tagged with this topic,then FME Server can perform additional events based on the protocols you have set up.
(Navigate tothis documentationfor information on the supported subscriber protocols in FME Server and how to properly configure each.)

Obtaining the direct URLs to trigger topics from FME Server is really easy:

  • Navigate to Topics in the FME Server Web UI (under Manage > Notifications)
  • Choose any existing topic
  • Select Developer Information to reveal the direct URL


Submitting Jobs with Webhooks

In FME Server,the application of Webhooks is not limited to using topics;it is possible to grab the direct URL for a workspace and use this in a Webhook.Any workspace can be automatically executed and configured to interpret any messages sent by the triggering event!The workspace can be configured to anyFME Server servicesuch as Data Download,作业提交者,and KML Network Link to name a few.

Obtaining the URLs to directly run a workspace is just as easy as for an FME Server topic:

  • Select Run Workspace from the FME Server Web UI
  • Choose the appropriate Repository,Workspace,and desired Service
  • On the Configure Workspace page,select Advanced > Show Developer Information to reveal the direct URL




Note that by default,the jobs will be submitted as the Guest/fmeguest account.Make sure that the proper permissions have been set in the FME Server Web UI (Manage > Administration > Security > Role Policies),or useToken Authentication.

Automation and Third-Party Integration with FME Server

Requirements

  • An account withSlackmessaging service


The power of FME Server doesn't stop with generating direct URLs for topics and workspaces.In fact,FME Server can send outgoing notifications – this means that FME Server can be used with any third party services that utilize Webhooks!
In this example,we will be using Slack.Through some simple configurations,and without writing any code,FME Server Notifications can be setup to send information about successful (or failed) jobs to messaging services.This provides an easy and effective way to monitor scheduling,automation,or general activity with FME Server.

The workspace used in this example is attached to this article and all the necessary configurations are noted below.


Step 1) Configure the Third-Party Service | Slack

Slack keeps you organized with purposeful channels.This example requires you to setup a channel to use for the purpose of receiving messages sent by a workspace run by FME Server..After creating a new channel,or selecting an existing one,add an "Incoming WebHooks Integration".The channel fme_notifications is used in this example.

  • Slack will then take you to a configuration page where you can select an existing Channel,or create a new one.Click on "Add Incoming WebHooks Integration" to retrieve the Webhook URL.



The URL will look similar to "https://hooks.slack.com/services/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" and will be used as the Slack Webhook URL parameter in the example FME Workspace.

Step 2) Configure the Workspace | FME Desktop

This example workspace has been configured such that any Failed Jobs will have a link provided to the Log File in the message posted to Slack.For these links to be valid,the following Translation Parameters must be set: FME Server,Username/Password,and Token Authentication.



Slack Webhook URL:
FME Server Hostname/IP: The hostname or IP address of your FME Server (e.g.http:// : )
Username/Password: The username and password of a user who has permissions to Manage Jobs (this can be verified via the FME Server Web UI > Manage > Administration > Security > Role Policies)
Token Authentication: A valid token can be obtained by accessing the REST API of your FME Server via http:// : /fmerest/ and selecting "Get Token" in the upper-right corner.
For more information about the Token Service,please see this documentation.

Step 3) Publish the Workspace | FME Desktop

Publish the example workspace fmeserver_slack_webhook_2015.fmw to your FME Server.

  • Select an existing Repository or create a new one.
  • Register the workspace with the Job Submitter service and set the "Source Dataset to Override with Web Content" to "incoming [TEXTLINE]" in the service properties.

Step 4) Setup the Notifications | FME Server Web UI

In order for the example workspace to send messages to Slack,it needs to subscribe to a topic that will be triggered by other workspaces run in FME Server.The subscription created will point to the direct URL of the workspace uploaded in Step 3.

  • To obtain the direct URL,select Run Workspace from the FME Server Web UI.Choose the workspace that was just uploaded and select the Job Submitter Service.

On the Configure Workspace page,select Developer Information to reveal the direct URL.Copy this link for use when the Subscription is created.

  • Create the topic named SLACK_WEBOOK using the FME Server Web UI (Manage > Notifications > Topics)

  • Create a new subscription named SLACK_TRIGGER using the FME Server Web UI (Manage > Notifications > Subscriptions).
  • Subscribe to the SLACK_WEBHOOK topic.

  • Set the protocol to Push and the Target URL to the direct URL obtained above.Important: Remove all the parameters after ".../fmeserver_slack_webhook_2015.fmw?"
Enter the HTTP Authentication information if necessary.


Step 5) Configure Workspaces to Post to Topic | FME Desktop

The last configuration step is setting which workspaces will post job status notifications to the Slack channel.This can be achieved in FME Desktop when publishing another workspace to FME Server.
Two workspaces have been included in this example package to test the Slack messages: simple_success.fmw and simple_fail.fmw.For each Registered Service selected,edit the properties and set the Notify on Job Completion to the SLACK_WEBHOOK topic.

Step 6) Test the Slack Webhook Integration | FME Server Web UI

Run any workspace with a Registered Service configured to post to the SLACK_WEBHOOK topic.Observe the results in Slack after the job completes.

Additional Resources and Information

Blog: Moving Data over the Web: AJAX vs.WebSockets vs.Webhooks
Triggering Notifications from a Workspace
FME Server Developer Playground: Trigger Notification
Webinar: How to Develop for Data Transformation with FME Server
Blog: Automation for the Enterprise

notification service integration slack webhooks Fri,15 Jul 2016 15:22:08 GMT rylanat亚搏在线safe