If you have an app on the Autodesk App Store then you might want to check if the user actually paid for and downloaded your app from the store or just copied it from someone else's computer. This what the Entitlement API can help you with.
This article will focus on the Windows OS. If you wish to achieve this on a MacOS, please navigate to the below link:
The Entitlement API is a simple RESTful API where you just need to send an HTTP GET request to the App Store server.
Since the Fusion API supports both C++ and Python, this article shall be covering both, should the need arise.
There are many library options that you could choose to make an HTTP request using C++. For this example, I installed this RestClient (which is a wrapper for the cURL library) and installed it using vcpkg.
Tip: When using vcpkg, it usually defaults to 32-bit platform. To set it to a 64-bit platform, you can set the environment variable as below:
I have also used this JsonCPP library to help parse the HTTP response.
Below are the steps that I needed to follow for implementation:
> Create a C++ Fusion add-in and edit it so it opens in Visual Studio. For detailed steps on how to create an add-in please refer: Creating a Script or Add-In.
> In Visual Studio, navigate to Project –> Properties -> Configuration Properties -> VC++ Directories -> Include directories.
Here add the full path to the Include directories where you have installed the libraries. For e.g.
Here, add the full path to the Lib folder. For e.g.
> Now navigate to Linker > Input > Additional Dependencies, and add the full path to the required lib files:
> Now add the following statements at the top of the CPP file.
using namespace std;
extern "C" XI_EXPORT bool run(const char* context)
app = Application::get();
ui = app->userInterface();
string userId = app->userId();
string appId = "1006119760063675415"; // App ID
string url =
+ string("?userid=") + userId + string("&appid=") + appId;
RestClient::Response response = RestClient::get(url);
bool isparseSuccessful = reader.parse(response.body, root);
ui->messageBox("Error parsing the string");
if ((root["IsValid"].asString()) == "true")
ui->messageBox("IsValid is True");
ui->messageBox("IsValid is False");
catch (exception ex)
> You can easily figure out the id of your app by finding it on the App Store and then checking the URL in the browser. That will contain an id parameter which is what you need in the appId variable used in the above code.
Now based on whether the app has been downloaded or not, you should either see:
Add the below lines to import the packages at the top of your .py file.
from .modules import requests
ui = None
app = adsk.core.Application.get()
ui = app.userInterface
userId = app.userId
url = "https://apps.exchange.autodesk.com/webservices/checkentitlement" +
"?userid=" + userId + "&appid=" + appId
r = requests.get(url)
resp_dict = json.loads(r.text)
val = resp_dict.get('IsValid')
ui.messageBox("IsValid is True")
ui.messageBox("IsValid is False")
You can find the full source code here: