The Type.World service operates its own API, and if you’re a font publisher of sorts who serves their own fonts under the Type.World JSON Protocol, chances are you want to interact with the central Type.World server using the API calls documented here. Whenever an APIKey is needed as a call parameter, you can obtain that key for your API Endpoint in the User Account section of this web site, visible after you’re successfully logged in.

validateAPIEndpoint

Remotely validate your Type.World API endpoint to build error messages right into your own backend.

Parameters:

command

Required

validateAPIEndpoint

subscriptionURL

Required

Complete subscription URL with protocols.

Return value:

success

The request returned successfully

failure

Validation failed. Please see the additional data fields information, warnings, errors, and especially stages for details on the process.

Additionally, the response contains the following data:

information

A list of non-critical information.

warnings

A list of warnings that you must pay attention to.

errors

A list of critical errors that must be fixed.

stages

Dictionary of test stages with detailed descriptions, results, and comments.

Python 3 example:

import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://type.world/api', urllib.parse.urlencode( \
{   'command': 'validateAPIEndpoint', \
    'subscriptionURL': 'typeworld://json+https//subscriptionID:secretKey@awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx'}).encode('ascii')).read().decode())
print(response)

Response:

{"response": "success"}
or
{"response": "failure", "errors": ["Invalid subscription URL"], "information": [], "warnings": ["Your API Endpoint does not use SSL (https://)."], "stages": ["Test stage details here."]}

verifyCredentials

Verify that a Type.World user account exists and that it is linked to a known app instance. In other words: Verify a valid user.

Parameters:

command

Required

verifyCredentials

anonymousTypeWorldUserID

Required

Anonymous Type.World User ID

anonymousAppID

Required

Anonymous App ID

APIKey

Required

Secret API Key for an API Endpoint, to be obtained through the Type.World user account

Return value:

success

This user and app are known and not revoked.

invalid

The combination of anonymousAppID and anonymousTypeWorldUserID is either unkown or known and revoked.

unknownAnonymousTypeWorldUserID

The user identified by unknownAnonymousTypeWorldUserID is unknown.

unknownAPIKey

The secret API Key for this API endpoint is unknown.

Python 3 example:

import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://type.world/api', urllib.parse.urlencode( \
{   'APIKey': 'GBuzxMs32CgAIbofFp6c', \
    'anonymousAppID': 'ea4723c0-112e-11ea-9348-8c8590145181', \
    'anonymousTypeWorldUserID': 'agp0eXBld29yQychELEgRVc2VyGIgPi9o4UJDA', \
    'command': 'verifyCredentials'}).encode('ascii')).read().decode())
print(response)

Response:

{"response": "success"}
or
{"response": "invalid"}

inviteUserToSubscription

Invite an existing Type.World user (identified by his/her email address) to a subscription link. This is the only secure way to share a subscription between users. The inviter is identified either by a source email address, which must also be a valid Type.World user account and actually hold that subscription, or by a API endpoint secret key, in which case the subscription must originate from that same API endpoint.

Parameters:

command

Required

inviteUserToSubscription

targetUserEmail

Required

Email address of target Type.World user

subscriptionURL

Required

Full subscription link including typeworld:// protocol and secret key and all.

sourceUserEmail

Email address of source Type.World user (not required, but either sourceUserEmail or APIKey needs to be present)

APIKey

Secret API Key of inviting API endpoint (not required, but either sourceUserEmail or APIKey needs to be present)

Return value:

success

The request returned successfully

invalidSubscriptionURL

The subscription URL is of invalid format.

invalidSource

The system could not identify a valid source by either sourceUserEmail or APIKey.

unknownTargetEmail

The email of the invited user is unknown.

sourceAndTargetIdentical

The source user and the target user are identical.

unknownSubscriptionForUser

The source user doesn’t hold that subscription.

invalidSourceAPIEndpoint

In case of an API Endpoint being the source of this request, it could not be identified by the APIKey parameter.

Python 3 example:

import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://type.world/api', urllib.parse.urlencode( \
{   'APIKey': 'GBuzxMs32CgAIbofFp6c', \
    'command': 'inviteUserToSubscription', \
    'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx', \
    'targetUserEmail': 'johndoe@gmail.com'}).encode('ascii')).read().decode())
print(response)

Response:

{"response": "success"}
or
{"response": "invalidSubscriptionURL"}

revokeSubscriptionInvitation

Revoke the invitation to a subscription for a Type.World user (identified by his/her email address). All subsequent invitation by that user to others will also be deleted.

Parameters:

command

Required

revokeSubscriptionInvitation

targetUserEmail

Required

Email address of target Type.World user

subscriptionURL

Required

Full subscription link including typeworld:// protocol and secret key and all.

sourceUserEmail

Email address of source Type.World user (not required, but either sourceUserEmail or APIKey needs to be present)

APIKey

Secret API Key of inviting API endpoint (not required, but either sourceUserEmail or APIKey needs to be present)

Return value:

success

The request returned successfully

invalidSubscriptionURL

The subscription URL is of invalid format.

invalidSource

The system could not identify a valid source by either sourceUserEmail or APIKey.

unknownTargetEmail

The email of the invited user is unknown in the system.

unknownSubscription

No matching subscription could be identified to be revoked.

Python 3 example:

import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://type.world/api', urllib.parse.urlencode( \
{   'APIKey': 'GBuzxMs32CgAIbofFp6c', \
    'command': 'revokeSubscriptionInvitation', \
    'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx', \
    'targetUserEmail': 'johndoe@gmail.com'}).encode('ascii')).read().decode())
print(response)

Response:

{"response": "success"}
or
{"response": "invalidSubscriptionURL"}

updateSubscription

Announce to all participating users that this particular subscription has changed and fresh data needs to be pulled by the client app from the publisher server.

Currently not yet implemented: If you supply the timeStretch parameter, all users of this subscription that are currently online with the app will be notified with a delay chosen randomly within your given time window. This way you can spread your server load according to the number of users of your subscription. However, since the delay is randomized, peaks may still occur.

Parameters:

command

Required

updateSubscription

APIKey

Required

Secret API Key for an API Endpoint, to be obtained through the Type.World user account

subscriptionURL

Required

Full subscription link including typeworld:// protocol and secret key and all.

timeStretch

Number of minutes (0—60) for which client apps will randomly wait to pull updated data from the publisher’s server. (Currently not implemented)

Return value:

success

The request returned successfully

invalidSubscriptionURL

Subscription URL is invalid.

invalidTimeStretchValue

Time stretch value is invalid.

unknownAPIKey

API key in unkown

unknownSubscriptionURL

No subscription under this URL exists.

Python 3 example:

import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://type.world/api', urllib.parse.urlencode( \
{   'APIKey': 'GBuzxMs32CgAIbofFp6c', \
    'command': 'updateSubscription', \
    'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx', \
    'timeStretch': 5}).encode('ascii')).read().decode())
print(response)

Response:

{"response": "success"}
or
{"response": "invalidSubscriptionURL"}