Account: Get Authentication Key

Collapse All

Description

Returns the account's authentication key. If the key doesn't exist yet, one is generated.

URL

https://api.fonts.com/rest/{format}/GetToken/

{format}

xml or json

Method

GET

Required Header Parameters:

  • AppKey Your application’s key
  • Password Account password

Required Query String Parameters:

  • wfsemailAddress used to create the account

Optional Query String Parameters:

  • none

Response variables:

  • MessageIf the response is successful then the “message” parameter of the response will be “Success” and if there is some error or failure then the “message” parameter will be the error message.
  • Account: AuthorizationKeyToken used for subsequent authentication of messages. If token already exists it is returned. If no token exists, one is created and returned. This API will not change an existing token. See Developer's Page for details.

Sample Code

PHP

<?php

require_once('Services_WFS.php');

$services = new Services_WFS;
$apiKey = '';
$services->setCredentials(null, null, $apiKey);

$email = '';
$password = '';
var_dump($services->getAccountAuthenticationKey($email, $password, false));
?>     

C#

     
private string GetToken(string emailAddress, string pass)
    {
      const string method = "GET";
      string requestUri = "/rest/" + Format + "/Accounts/" +
                                      "?wfsemail=" + emailAddress;

      //See common functions 
      return GetResponseSecure(method, requestUri, pass);

    }      

VB.NET

   
Private Function GetToken(ByVal emailAddress As String, ByVal pass As String) As String

    Const method As String = "GET"
    Dim requestUri As String = "/rest/" & Format & "/Accounts/" & _
                               "?wfsemail=" & emailAddress

    'See common functions for GetResponse
    Return GetResponseSecure(method, requestUri, pass)

End Function      

XML Response

<Accounts>
  <Message>Success</Message>
  <Account>
    <AuthorizationKey>f160cc8a-d146-40ac-b81b-995f2acae6b3--542b18c0-61ca-4b5d-8eeb-af4cbca9df1bCD-AE-B1-28-2D-61-47-72-BE-B1-E7-4C-19-2B-EB-DA</AuthorizationKey>
  </Account>
</Accounts>      

Json Response

{
   "Accounts":{
      "Account":{
         "AuthorizationKey":"f160cc8a-d146-40ac-b81b-995f2acae6b3--542b18c0-61ca-4b5d-8eeb-af4cbca9df1bCD-AE-B1-28-2D-61-47-72-BE-B1-E7-4C-19-2B-EB-DA"
      },
      "Message":"Success"
   }
}