Publish Extension
Marq offers the ability to publish projects to a variety of platforms and distribution channels. A publish extension allows a user to select a partner destination within Marq's Publish menu.
A publish extension can publish the user's design in any of the following formats:
- JPG
- PNG
- MP4
- GIF
In order to create a new option with Marq's publish menu, the partner is required to provide the following to Marq via [email protected]:
- Icon Image for the publish menu and logos for Marq's app market place
- Destination URL domain
- File Types supported
Token Generation
In order to securely share information about the user and asset, a JWT token will be generated by Marq. This token is composed of fields with information on the user and the design, to be used in the Partner's platform.
The Token is passed from Marq to the partner as a query parameter with token as key.
The partner will provide the destination URL to Marq which will be used to send the asset and additional information about the user.
{{partner domain}}/?token={{token}}
Example:
https://partner.com/?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI8and0LWlkPiIsInVzZXJJZCI6Ijx1c2VyLWlkPiIsInByb2plY3RJZCI6Ijxkb2N1bWVudC1pZD4iLCJwcm9qZWN0TmFtZSI6Ijxkb2N1bWVudC1uYW1lPiIsImRvd25sb2FkVXJsIjoiPHNpZ25lZC11cmw-IiwiY29udGVudExlbmd0aCI6Ijxjb250ZW50LWxlbmd0aD4iLCJtaW1lVHlwZSI6ImFwcGxpY2F0aW9uL3BkZiJ9.ihy6ooidwsJ95HfW6uhokw2cR9wJ0JpdYb-bCSzK_Dt8QIcuAsjcJCWjuEoHyVBVYuOA2_E7Dxv_qUwaEcKaBjwtaV7zhj_eeZZFAcZ6i0oFFHj7KUWWX_DWMUvQPu4dkXia190cesf9XLmkTbKlY_ipzgiVPKzgeNlAYRf0xIFrSqKqGL0P3weL2XXgos6vwuSNyBuUx5kFOpB89JMmw3eKxG23KVk2zdWerb1uVr0ufWlGZuhOrO7r5JPGKSjcn3X0DxwLBWs1mbudpDt2gitlmLVKNHWkrozzmOW4Xswb120mUVaoIgTUKoFvcxiaXLwgHBq5a96Lu1IKsdK7YA
Token Format
Here are the JWT parts you can expect in the payload from Marq. You can learn more about JWTs and find libraries at jwt.io
- Header
-
{ "alg": "RS256", "typ": "JWT" }
-
- Payload
-
{ "jti": "<jwt-id>", "userId": "<user-id>", "projectId": "<document-id>", "projectName": "<document-name>", "downloadUrl": "<signed-url>", "contentLength": "<content-length>", "mimeType": "application/pdf" }
-
- Signature
- Public Key (to be created)
Fields Provided Within Token
Although not required to use all metadata fields that Marq provides, it is required to receive the following fields and others that may be provided optionally in the future. It is recommended that the following fields should be used to route users to the partner's account
- jti - Prevent a replay attack by verifying the JTI hasn't been processed
- userId - the user email login which is unique to the user in Marq
- projectId - Marq's unique identifier of the design/document
- downloadUrl - endpoint of the downloadable asset of the Marq design/document
- projectName - name of the design/project created from Marq. This will be the reference often a user will leverage to know various designs created within Marq
- contentLength - number of bytes for download from downloadUrl
- mimeType - mime type for download from downloadUrl
NOTE: As convention, all fields are camelCase.
Updated 7 months ago