You are here: Reference Manual > FME Server Web Services > Utility Services > Token Service > Examples
Examples
Here is an example URL request using the FME Token Service API:
http://<host>:<port>/fmetoken/generate?user=admin&password=admin&expiration=3&timeunit=day
The token service first authenticates the specified user ID and password credentials. It returns an HTTP Not Authorized error code if these credentials are not accepted.
In this example request, the token service generates a token for user admin with password admin. The token will expire after 3 days.
The resulting token is returned to the client as plain text via HTTP. To return a token in JSON, use the .json
suffix:
http://<host>:<port>/fmetoken/generate.json?user=admin&password=admin&expiration=3&timeunit=day