Question

Cityworks Action manager unable to trigger to FME Topics


Badge

Hi, FME topics are not triggering from cityworks Action manager, FME throws a bad request error. I assume there is some special configuration required on Subscriptions / topics in order for Cityworks to work? Any help is appreciated. @nathanatsafe


10 replies

Badge +7

Hi @mannanhere,

 

Thanks for your question! Could you attach a screenshot of your Cityworks webhook? Also can you let me know what version of Cityworks you are using?

 

 

Generally I use the "Message as Subscriber Settings" topic URL from FME Server. It looks something like this:

https://<FME Server Host>/fmerest/v3/notifications/topics/<Topic Name>/message?fmetoken=<token>

 

You'll need to make sure that your FME Server is accessible from Cityworks (on the same network or publicly accessible via the web) and that your token is valid. I have had success using FME Cloud to set up Cityworks - FME workflows in the past.

 

 

Hope this helps,

 

Nathan
Badge

Hi Nathan,

Thank you for your response, here are some screenshots and details. I am using Cityworks 15.3.3. Both Cityworks and FME server are on same Machine and accessible. I tried Postman to trigger the FME topic and it works but not through Action Manager

I am using the Topic URL as below: "http://XXX/fmerest/v3/notifications/topics/cityworks.trigger/message"

and then supplying credential user and password. I have tried the other way as well. with having fmetopic as query string.

@nathanatsafe

Badge +7

Hi Nathan,

Thank you for your response, here are some screenshots and details. I am using Cityworks 15.3.3. Both Cityworks and FME server are on same Machine and accessible. I tried Postman to trigger the FME topic and it works but not through Action Manager

I am using the Topic URL as below: "http://XXX/fmerest/v3/notifications/topics/cityworks.trigger/message"

and then supplying credential user and password. I have tried the other way as well. with having fmetopic as query string.

@nathanatsafe

Hi @mannanhere,

Thanks for the additional info. It does seem at-a-glance like your Cityworks webhook is set up correctly. If you check the message queue in Cityworks do you see the messages being set, failing, or pending? If pending, they might be getting stuck in the queue. Another thing worth checking would be the FME Server service log (for REST calls) and tomcat localhost_access logs. If you see anything in there from Cityworks then you know that there is data coming through at least.

 

Finally I remember vaguely that there may have been a bug in Cityworks with HTTP POSTs around your version so it might be worth checking in with your support contact at Cityworks.

 

Hope this helps,

Nathan

Badge

Hi Nathan,

Thank you for your response, here are some screenshots and details. I am using Cityworks 15.3.3. Both Cityworks and FME server are on same Machine and accessible. I tried Postman to trigger the FME topic and it works but not through Action Manager

I am using the Topic URL as below: "http://XXX/fmerest/v3/notifications/topics/cityworks.trigger/message"

and then supplying credential user and password. I have tried the other way as well. with having fmetopic as query string.

@nathanatsafe

Hi Nathan,

Thanks for the help, I was able to get the Action Manager working, I think the problem was supplying the FME token with the URL instead of Credentials in Action Manager and also probably due to how the data was being sent. The topic is being triggered now.

But I am facing another issue, after deploying Cityworks FME project, I took the FME Workspace, to be able to update the transformers with parameters based on my environment and run it first in FME desktop. I am using FME 2019 and Cityworks connector errors out saying its old version. And, there is also the JSON reader in the start that requires a dataset to set the "Address" Json schema, trying to Run the workspace and it throws an error. How did you setup Cityworks connector and JSON reader without pointing it to dataset?

is it possible to have a webex call with you, I am very close to get it to working. Whats is you emailID? Appreciate your help

Thanks Abdul

Badge

Hi @mannanhere,

 

Thanks for your question! Could you attach a screenshot of your Cityworks webhook? Also can you let me know what version of Cityworks you are using?

 

 

Generally I use the "Message as Subscriber Settings" topic URL from FME Server. It looks something like this:

https://<FME Server Host>/fmerest/v3/notifications/topics/<Topic Name>/message?fmetoken=<token>

 

You'll need to make sure that your FME Server is accessible from Cityworks (on the same network or publicly accessible via the web) and that your token is valid. I have had success using FME Cloud to set up Cityworks - FME workflows in the past.

 

 

Hope this helps,

 

Nathan

@nathanatsafe,

I'm following your article https://knowledge.safe.com/articles/100665/integrating-cityworks-and-fme.html to set up webhook action triggers between Cityworks and FME server.

But I have the same problem where the topic is not triggered in FME server,

resolved the network firewall issues between the two servers ,but I still get (401 unauthorized) or (400 bad request) errors when I use the "Message as Subscriber Settings " url in Action Manager.

Hoping to find some answers to resolve this issue.

Thank you

Adi

Badge +7

@nathanatsafe,

I'm following your article https://knowledge.safe.com/articles/100665/integrating-cityworks-and-fme.html to set up webhook action triggers between Cityworks and  FME server.

But I have the same problem where the topic is not triggered in FME server,

resolved the network firewall issues between the two servers ,but I still get (401 unauthorized) or (400 bad request) errors when I use the "Message as Subscriber Settings " url in Action Manager.

Hoping to find some answers to resolve this issue.

Thank you

Adi

Hi @adi,

 

 

From the response codes it sounds like the message is getting through to FME Server, but there may be a problem with the request or a permissions issue. 

From the FME Server REST API documentation:

400 Bad Request: The request was improperly formatted. Typically, this means that your JSON or XML is not well-formed. It may also mean that the URI is invalid; most path components can only contain alphanumeric characters.
401 Unauthorized: Authentication credentials are missing or incorrect.

Are you sure the token you're using with the topic URL has the appropriate permissions? Have you specified the Content-Type header in Cityworks Action Manager? Is your "Template" field (the data payload sent to FME Server) valid JSON?

Nathan

Badge

Hi @adi,

 

 

From the response codes it sounds like the message is getting through to FME Server, but there may be a problem with the request or a permissions issue. 

From the FME Server REST API documentation:

400 Bad Request: The request was improperly formatted. Typically, this means that your JSON or XML is not well-formed. It may also mean that the URI is invalid; most path components can only contain alphanumeric characters.
401 Unauthorized: Authentication credentials are missing or incorrect.

Are you sure the token you're using with the topic URL has the appropriate permissions? Have you specified the Content-Type header in Cityworks Action Manager? Is your "Template" field (the data payload sent to FME Server) valid JSON?

Nathan

Thank you @nathanatsafe

your sugesstions have really helped me ,I had invalid Json in my Template field.

appreciate it

Badge +7

Thank you @nathanatsafe

your sugesstions have really helped me ,I had invalid Json in my Template field.

appreciate it

That's great! Happy integrating.

Badge

Hi @adi,

 

 

From the response codes it sounds like the message is getting through to FME Server, but there may be a problem with the request or a permissions issue. 

From the FME Server REST API documentation:

400 Bad Request: The request was improperly formatted. Typically, this means that your JSON or XML is not well-formed. It may also mean that the URI is invalid; most path components can only contain alphanumeric characters.
401 Unauthorized: Authentication credentials are missing or incorrect.

Are you sure the token you're using with the topic URL has the appropriate permissions? Have you specified the Content-Type header in Cityworks Action Manager? Is your "Template" field (the data payload sent to FME Server) valid JSON?

Nathan

Hello @nathanatsafe,

The fmetoken for the topic expires every day ,How would I change it to something that does not expire?

Badge +7

Hello @nathanatsafe,

The fmetoken for the topic expires every day ,How would I change it to something that does not expire?

Hi @adi,

It might be best to create your own token and set the expiration. How you do this will vary slightly depending on your FME Server version. Please find a complete guide here: https://knowledge.safe.com/articles/101747/token-management-in-fme-server-2019.html.

 

Hope that helps!

 

Nathan

Reply