Twickd DRM API

Published by Hugo
Oct 11th, 2019 - 02:22PM

Here at Twickd, we care a lot about our developers and users get the best experience possible while sharing and downloading packages.

Thanks to the impulse of our good friend Dave van Wijk, we are thrilled to introduce the new Twickd DRM API!

A brand new way to secure your package against crackers and malicious people! With just one simple request you can securely know if the device that is running your tweak bought it or not!

To prevent people from abusing this system, you have to be a member of the Developer Plus Program in order to use the DRM API. It's also, as of right now, not usable in free packages.

Thanks for your understanding

Request

Endpoint

POST https://twickd.com/api/drm

You can either hit the Twickd DRM API directly with Url queries:

https://twickd.com/api/drm?key=9dea8d62a27d3d56c5dd6b2304dbe81b&udid=TEST&identifier=com.twickd.tacitus

Or with JSON in the Request body:

{
    "key": "9dea8d62a27d3d56c5dd6b2304dbe81b",
    "udid": "TEST",
    "identifier": "com.twickd.tacitus"
}

We strongly encourage you to use a server as a middleware between your Tweak and Twickd DRM API to prevent your Developer Key from being accessible. We can not be taken as responsible if your Developer Key is leaked.

Parameters

key : Your developer key (that can be found on your Developer Settings)

udid : The Unique Device Identifier, you can grab it in your tweak using the following method:

# Declare
OBJC_EXTERN CFStringRef MGCopyAnswer(CFStringRef key) WEAK_IMPORT_ATTRIBUTE;

# Use this to get the UDID
CFStringRef UDID = MGCopyAnswer(CFSTR("UniqueDeviceID"));

identifier : The Package Identifier (i.e: com.twickd.tacitus)

None of those parameters are optional, which means you must fill them all otherwise the request will return an error.

Response

Success! The device is allowed to use your Package

{
    "success": true,
    "code": 200
}

Failure. The device is not allowed to use your Package

{
    "success": false,
    "code": 201,
    "error": "This device is not allowed to use this Package"
}

Bad Request. Your request was not understood by our server. Reformat your request and try again

{
    "success": false,
    "code": 400,
    "error": "Bad Request"
}

Unknown error

{
    "success": false,
    "code": 500,
    "error": "An unknown error occured. Please try again later"
}

If you experience any issue with the DRM system, please contact us!

Advertissement