Skip to main content
Solved

FME Server email read from fme user

  • February 26, 2019
  • 3 replies
  • 82 views

giosp
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 51 replies

I use FME Server 2018. I'd like to send the result of a job to the user that submitted the job. I'd like to retrieve the email from the users list inside fme server because there are synchronized with Active Directory. With the FME_SECURITY_USER I've got the user but there aren't others FME_SERVER variables that contains the email. How I can get this information?

 

Thank you for suggestions.

Best answer by david_r

I suspect the only option is to use the REST API to retrieve the user properties based on FME_SECURITY_USER:

GET /security/accounts/$(FME_SECURITY_USER)

Response:

account {
  email (string, optional): Email of the account,
  enabled (boolean): Whether the account is currently enabled or not,
  fullName (string): Full name of the account,
  name (string): Unique name of the account,
  password (string): Account password,
  roles (array[string], optional): Roles assigned to the account,
  type (string) = ['System' or 'Ldap']: Type of the account
}

You can use the FME_SERVER_HOST + FME_SERVER_PORT as a basis for the query URL.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • February 26, 2019

I suspect the only option is to use the REST API to retrieve the user properties based on FME_SECURITY_USER:

GET /security/accounts/$(FME_SECURITY_USER)

Response:

account {
  email (string, optional): Email of the account,
  enabled (boolean): Whether the account is currently enabled or not,
  fullName (string): Full name of the account,
  name (string): Unique name of the account,
  password (string): Account password,
  roles (array[string], optional): Roles assigned to the account,
  type (string) = ['System' or 'Ldap']: Type of the account
}

You can use the FME_SERVER_HOST + FME_SERVER_PORT as a basis for the query URL.


giosp
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 51 replies
  • February 27, 2019

I suspect the only option is to use the REST API to retrieve the user properties based on FME_SECURITY_USER:

GET /security/accounts/$(FME_SECURITY_USER)

Response:

account {
  email (string, optional): Email of the account,
  enabled (boolean): Whether the account is currently enabled or not,
  fullName (string): Full name of the account,
  name (string): Unique name of the account,
  password (string): Account password,
  roles (array[string], optional): Roles assigned to the account,
  type (string) = ['System' or 'Ldap']: Type of the account
}

You can use the FME_SERVER_HOST + FME_SERVER_PORT as a basis for the query URL.

Hi @david_r , thank you for your suggestion. Is a good idea. Yesterday I've cheked the other way to querying the useraccount table in fmeserver db and get the mail from it and works. I will to switch to api to have more flexibility in the future.

I open an Idea to create a new variables like FME_SECURITY_USER but f.e. FME_SECURITY_USER_EMAIL with the email automagically set by fme.

Thank you


david_r
Celebrity
  • 8394 replies
  • February 27, 2019

Hi @david_r , thank you for your suggestion. Is a good idea. Yesterday I've cheked the other way to querying the useraccount table in fmeserver db and get the mail from it and works. I will to switch to api to have more flexibility in the future.

I open an Idea to create a new variables like FME_SECURITY_USER but f.e. FME_SECURITY_USER_EMAIL with the email automagically set by fme.

Thank you

That's a nice workaround, but since you're using an undocumented function be sure to specifically re-test this every time you upgrade FME Server.

I voted for your idea, it's a good one.