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.
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:
| Required | Anonymous Type.World User ID |
| Required | Anonymous App ID |
| Required | Secret API Key for an API Endpoint, to be obtained through the Type.World user account |
| Complete subscription URL (Format C) that the user is trying to access. If this parameter is given, the user must already hold the subscription for the verification to be valid. This conforms with "Security Level 2" of the developer documention. |
Return value:
| This user and app are known and not revoked. |
| The combination of anonymousAppID and anonymousTypeWorldUserID is either unkown or known and revoked. |
| The user identified by unknownAnonymousTypeWorldUserID is unknown. |
| The secret API Key for this API endpoint is unknown. |
| The user’s email address isn’t verified. A new verification email has been sent. |
Python 3 Example:
import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://api.type.world/v1/verifyCredentials', urllib.parse.urlencode( \
{ 'APIKey': 'GBuzxMs32CgAIbofFp6c',
'anonymousAppID': 'ea4723c0-112e-11ea-9348-8c8590145181',
'anonymousTypeWorldUserID': 'agp0eXBld29yQychELEgRVc2VyGIgPi9o4UJDA'} \
).encode('ascii')).read().decode())
print(response)
Response:
{"response": "success"}
or
{"response": "invalid"}
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:
| Required | Email address of target Type.World user |
| Required | Full subscription link including typeworld:// protocol and secret key and all. |
| Email address of source Type.World user (not required, but either | |
| Secret API Key of inviting API endpoint (not required, but either |
Return value:
| The request returned successfully |
| The subscription URL is of invalid format. |
| The system could not identify a valid source by either |
| The email of the invited user is unknown. |
| The source user and the target user are identical. |
| The source user doesn’t hold that subscription. |
| In case of an API Endpoint being the source of this request, it could not be identified by the APIKey parameter. |
| Inviting users requires a Pro Plan for the user account. |
Python 3 Example:
import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://api.type.world/v1/inviteUserToSubscription', urllib.parse.urlencode( \
{ 'APIKey': 'GBuzxMs32CgAIbofFp6c',
'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx',
'targetUserEmail': 'johndoe@gmail.com'} \
).encode('ascii')).read().decode())
print(response)
Response:
{"response": "success"}
or
{"response": "invalidSubscriptionURL"}
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:
| Required | Email address of target Type.World user |
| Required | Full subscription link including typeworld:// protocol and secret key and all. |
| Email address of source Type.World user (not required, but either | |
| Secret API Key of inviting API endpoint (not required, but either |
Return value:
| The request returned successfully |
| The subscription URL is of invalid format. |
| The system could not identify a valid source by either |
| The email of the invited user is unknown in the system. |
| 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://api.type.world/v1/revokeSubscriptionInvitation', urllib.parse.urlencode( \
{ 'APIKey': 'GBuzxMs32CgAIbofFp6c',
'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx',
'targetUserEmail': 'johndoe@gmail.com'} \
).encode('ascii')).read().decode())
print(response)
Response:
{"response": "success"}
or
{"response": "invalidSubscriptionURL"}
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.
Using this command is only available to publishers participating in the Pro Publisher Plan, available from your user account at https://type.world/account/developer (after login).
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:
| Required | Secret API Key for an API Endpoint, to be obtained through the Type.World user account |
| Required | Full subscription link including typeworld:// protocol and secret key and all. |
| 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:
| The request returned successfully |
| Subscription URL is invalid. |
| Time stretch value is invalid. |
| API key in unkown |
| No subscription under this URL exists. |
| Please set up your paid publisher subscription at https://type.world/account |
Python 3 Example:
import json, urllib.request, urllib.parse
response = json.loads(urllib.request.urlopen('https://api.type.world/v1/updateSubscription', urllib.parse.urlencode( \
{ 'APIKey': 'GBuzxMs32CgAIbofFp6c',
'subscriptionURL': 'typeworld://json+https//awesomefonts.com/typeworldapi/daz4Ub54mut2XDLz6vGx',
'timeStretch': 5} \
).encode('ascii')).read().decode())
print(response)
Response:
{"response": "success"}
or
{"response": "invalidSubscriptionURL"}