Account: Create an Account (Free only)

Collapse All

Description

Initiates the account creation process, causing an email to be sent to address provided.

URL

http://api.fonts.com/rest/{format}/Accounts/

{format}

xml or json

Method

Post

Required Header Parameters:

  • AppKey Your application’s key

Required Query String Parameters:

  • wfsfirst_nameProvided account
  • wfslast_nameProvided account
  • wfsemailProvided 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: FirstNameAs provided when account was created
  • Account: LastNameAs provided when account was created
  • Account: EmailNameAddress to which verification email will be sent

Sample Code

PHP

<?php

require_once('Services_WFS.php');

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

$firstName = '';
$lastName = '';
$email = '';
var_dump($services->newAccount($firstName, $lastName, $email));

?>       

C#

 private string CreateNewAccount(string firstName, string lastName, string emailAddress)
    {
      const string method = "POST";
      string requestUri = "/rest/" + Format + "/Accounts/";

      string data = "wfsfirst_name=" + firstName +
                    "&wfslast_name=" + lastName +
                    "&wfsemail=" + emailAddress;

      //See common functions
      return GetResponseWithoutAuthorization(method, requestUri, data);

    }       

VB.NET

Private Function CreateNewAccount(ByVal firstName As String, ByVal lastName As String, ByVal emailAddress As String) As String

    Const method As String = "POST"
    Dim requestUri As String = "/rest/" & Format & "/Accounts/"

    Dim data As String = "wfsfirst_name=" & firstName & _
                         "&wfslast_name=" & lastName & _
                         "&wfsemail=" & emailAddress

    'See common functions for GetResponse
    Return GetResponseWithoutAuthorization(method, requestUri, data)

  End Function         

XML Response

<Accounts>
  <Message>Success</Message>
  <Account>
    <FirstName>John</FirstName>
    <LastName>Doe</LastName>
    <Email>John@exmaple.com</Email>
  </Account>
</Accounts>       

Json Response

{
   "Accounts":{
      "Account":{
         "Email":"John@exmaple.com",
         "FirstName":"John",
         "LastName":"Doe"
      },
      "Message":"Success"
   }
}