Skip to main content
Skip table of contents

PICTOFiT Platform

Our PICTOFiT Platform is a service for hosting your virtual garments, avatars and scenes for you. Every resource that has been processed through our PICTOFiT Content Service is automatically available on the PICTOFiT Platform.

The platform provides a Public API for fetching resources and a access-controlled Merchant API for manipulating resources. The API provides functionality to define and query for external references. This means that you can use your SKUs/Product IDs/… to query for resources. The only thing you have to do is to set up this reference once. The following steps outline the typical process when adding new resources (mostly virtual garments) to the platform.

  1. Upload your images to the PICTOFIT CMS or through the Merchant API of the PICTOFIT Platform

  2. Once processing has finished, they are automatically available on the PICTOFiT Platform

  3. Set up an external reference using the merchant API

  4. In your resource provider, query the assets using the public API. Check the Example section to see how to query the PICTOFiT Platform.

To use the merchant API, you will need your organizationID as well as an access token. Please contact support@reactivereality.com to receive both. The access token needs to provided in the requests header:

JSON
{
"Authorization" : "Bearer YOUR-TOKEN"
}

Please be aware the the URLs for the API when querying from code are https://api.platform.pictofit.com/graphql/public/v1 and https://api.platform.pictofit.com/graphql/merchant/v1 respectively.

If you use the GraphiQL interface (which is linked above for both APIs), also make sure to provide the token in the Headers section below the query editor.

Setting up External References

To set up your external reference for a resource, you will need your access token as well as the ID of your resource in the PICTOFiT Content Service. When creating your resource through the PICTOFiT CMS, you can find the ID of the resource (request) in the browser’s URL field. When creating requests through the API, you can provide your own GUID.

The Merchant API provides the a mutation called addExternalReference which let’s you define a reference.

GRAPHQL
mutation {
  addExternalReference(theReference:"gid://your-reference-format"
  forRequest:"a523f380-05bb-4317-84d3-dd0c7931a10c") {
    id
    reference
  }
}

Please be aware that this adds a new external reference but doesn’t change or replace any existing ones. This also means that there can be multiple external references to the same resource on the PICTOFiT Platform.

Querying for a Resource

Now when you want to use resources in your dressing room, you have to query the Public API using your external reference. The following snippet shows what such a GraphQL query could look like for a garment:

GRAPHQL
query custom {
  findMetadata(
    forOrganization: "YOUR-ORGANIZATION-ID"
    forReferences: "YOUR-EXTERNAL-REFERENCE"
    forKind: GARMENT_2D
    forFormat: WEB
  ) {
    name
    assets {
      id
      files {
        fileName
        getLocation
      }
    }
  }
}

Make sure to provide your organisation ID and the external reference you have set up in the previous step in the respective fields. forKind depends on the type of resource and can be one of GARMENT_2D, GARMENT_3D, AVATAR_2D, AVATAR_3D or SCENE. The result of this query looks somewhat like this:

JSON
{
  "data": {
    "findMetadata": [
      {
        "name": "MARNI Cropped trousers in blue tropical wool ",
        "assets": [
          {
            "id": "659fa01d-1cd2-4c18-8d11-5110928abf67",
            "files": [
              {
                "fileName": "mesh.drc",
                "getLocation": "https://pictofit-platform.f21e22a4fbbf2fdc7fbae60413530984.r2.cloudflarestorage.com/1678e8fe-7964-433d-8265-4c0140924bef/5d133f8e-cf8c-4fdf-bfe5-d138269b41e5?x-id=GetObject&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=fa329d5876ec80cb82dbf8e4b59fa5ff%2F20231018%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20231018T083007Z&X-Amz-Expires=172800&X-Amz-SignedHeaders=host&X-Amz-Signature=dbddea9e4681427141aa0944fbf94d5defbcd217d5383a36b860171db257c44c"
              },
              ...
            ]
          }
        ]
      }
    ]
  },
  ...
}

The files section contains the assets you need to provide to the MDR through the getById() method of the host adaptor. Have a look at the Example Implementation for more details.

Summary

The PICTOFiT Platform hosts the assets of a virtual garment, avatar or scene for you. By setting up an external reference, you can easily link these resources to products in your store.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.