Design Streaming IntegrationΒΆ

Authentise’s partners have been using the Authentise Design Streaming API for some time to upload and stream models to their customers. Previously, the partner uploaded the model each time a new print was created. With the release of 3DIAX we can improve and simplify this workflow considerably.

First we’ll need to create a new user account for the integration. You can follow the instructions at Client Authentication to create a user. This step only needs to be done once. Save the username and password somewhere so that your code can create a new session periodically. You’ll need to include a valid session cookie in every request to 3DIAX.

Next we’ll need to add some assets to 3DIAX. You can refer to either the 3DIAX Tutorial or the 3DIAX API Reference to look up information on how to upload models to 3DIAX. For convenience, here is an example request for creating a new model:

POST https://models.authentise.com/model/
Content-Type: application/json

{
  "name": "Authentise logo",
  "callback": {
    "url" : "https://my.domain.net",
    "method" : "POST",
  }
}
Location: https://models.authentise.com/model/abc-xyz/
X-Upload-Location: https://models.authentise.com/qqwwerrettdff/

The content of the model should then be sent to the URL at X-Upload-Location via an HTTP PUT request. The body of the request should be the model data. You should store the URI that is returned in the Location header in your own database. That is how you will refer to this model in the future.

Finally, we need to create a token for printing the model. Previously this would have been done via a GET request to http://widget.sendshapes.com:3000/api3/api_create_partner_token. Now you make the request as a POST to https://print.authentise.com/token/. For example:

POST https://print.authentise.com/token/
Content-Type: application/json

{
    "api_key"               : "abc...123",
    "receiver_email"        : "someone@gmail.com",
    "model"                 : "https://models.authentise.com/model/abc-xyz/",
    "print_value"           : 10.56,
    "print_value_currency"  : "USD",
    "partner_job_id"        : "job-123",
}

The response to this request will have status code 201 on success and return a header, X-Token-Location which contains the URL that should be used to create the iframe for displaying the Authentise Widget. This corresponds to the token_link or ssl_token_link that is returned from api_create_partner_token. We no longer distinguish between an SSL and non-SSL token link - all links will use SSL.

X-Token-Location: https://app.authentise.com/#/widget/77f3406a-6be3-4d1d-b49a-03c0e8984615

This token link will use the model that was uploaded in the first step because we referenced the model URI when creating the token. We can create as many tokens as we would like with this model without needing to upload the model again. The model will be securely stored in 3DIAX and backed-up for safe keeping. There is no limit to the number of models that you can store in this way. The Model Streaming API will keep track of the models used so that you can easily determine model popularity. You can also use the snapshot feature of 3DIAX to produce simulated images for customers before making their purchases.

3DIAX makes it easy to securely store your models and allow customers to print them through the cloud. If you’d like to create a new integration with Authentise or migrate your existing integration to taking advantage of 3DIAX, please contact us at info@authentise.com