---
title: How to Use the Conversion API
slug: how-to-use-the-conversion-api
docTags: 
createdAt: 2022-04-05T16:09:46.000Z
---

In this guide you'll find information in case you want to use our conversion to a streamable model system  as an API.



You can use the API by sending HTTPS requests to [https://api.senseofspace.io/ConversionApi](https://api.senseofspace.io/ConversionApi)

Parameters can be sent either in query string or as a JSON string in the request body.



# Authentication

Every request requires your user id and password as parameters as follows:

**u**: “youruserid”

**p**: “yourpassword”



# Create a streamable asset

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.senseofspace.io/ConversionApi",
  "name": "create_streamable_asset",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "action",
        "type": "string",
        "description": "Set this to \"create_streamable_asset\""
      },
      {
        "kind": "required",
        "name": "asset_name",
        "type": "string",
        "description": "Asset name. e.g. my_model. Then the URL of the asset would be https://stream.senseofspace.io/myuser/my_model"
      },
      {
        "kind": "required",
        "name": "p",
        "type": "string",
        "description": "Password"
      },
      {
        "kind": "required",
        "name": "u",
        "type": "string",
        "description": "User name"
      },
      {
        "kind": "optional",
        "name": "photogrammetry",
        "type": "Boolean",
        "description": "Set this to true if the model is a photogrammetry or scanned model. Default false."
      },
      {
        "kind": "optional",
        "name": "model_name",
        "type": "string",
        "description": "Optional model name"
      },
      {
        "kind": "optional",
        "name": "model_by",
        "type": "string",
        "description": "Optional model provider name"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "1le1x3DJYUqB4fN0doXNd",
        "code": "48e99d92300cd0911602999668f54f23a5d32ef8",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "LIkO9xsJkwTucUXjMmKHz",
        "code": "",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "1le1x3DJYUqB4fN0doXNd"
  },
  "examples": {
    "languages": [
      {
        "id": "oN7sgQLZ3pbqFRMN4GQVW",
        "code": "curl --request POST\n  --url https://api.senseofspace.io/ConversionApi\n  --header 'Accept: application/json'\n  --data-raw '{\n    \"u\":\"my_user_name\",\n    \"p\":\"my_very_secret_pass\",\n    \"action\":\"create_streamable_asset\",\n    \"asset_name\":\"my_new_model\",\n    \"photogrammetry\":false\n}'",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "oN7sgQLZ3pbqFRMN4GQVW"
  },
  "description": "Creates a streamable asset entry for conversion. Returns the id of the created streamable asset.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::



# Get URL to upload the model file to be converted

After creating a streamable asset entry, you need to upload a model to start the conversion.&#x20;

**Only .GLB files are supported currently.**

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.senseofspace.io/ConversionApi",
  "name": "get_streamable_asset_upload_url",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "action",
        "type": "string",
        "description": "Set this to \"get_streamable_asset_upload_url\"."
      },
      {
        "kind": "required",
        "name": "asset_id",
        "type": "string",
        "description": "ID of a streamable asset which has not been converted yet."
      },
      {
        "kind": "required",
        "name": "p",
        "type": "string",
        "description": "Password"
      },
      {
        "kind": "required",
        "name": "u",
        "type": "string",
        "description": "Username"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "aSY9V84-VVKu5cGeVF9sf",
        "code": "https://some.url.where/to/put/the?file",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "z_bcXzRp2mBChCDxNHtXb",
        "code": "",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "aSY9V84-VVKu5cGeVF9sf"
  },
  "examples": {
    "languages": [
      {
        "id": "Bziy8QKoRjm3_v9VfXLy1",
        "code": "curl --request POST\n  --url https://api.senseofspace.io/ConversionApi\n  --header 'Accept: application/json'\n  --data-raw '{\n    \"u\":\"my_user_name\",\n    \"p\":\"my_very_secret_pass\",\n    \"action\":\"get_streamable_asset_upload_url\",\n    \"assest_id\":\"48e99d92300cd0911602999668f54f23a5d32ef8\"\n  }'",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "Bziy8QKoRjm3_v9VfXLy1"
  },
  "description": "Returns a URL you can use to upload a .glb model file with a PUT request. Valid for 15 minutes.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::



# Remove a streamable asset

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.senseofspace.io/ConversionApi",
  "name": "remove_streamable_asset",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "action",
        "type": "string",
        "description": "Set this to \"remove_streamable_asset\"."
      },
      {
        "kind": "required",
        "name": "asset_id",
        "type": "string",
        "description": "ID of the streamable asset to be removed"
      },
      {
        "kind": "required",
        "name": "p",
        "type": "string",
        "description": "Password"
      },
      {
        "kind": "required",
        "name": "u",
        "type": "string",
        "description": "Username"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "TZgO0MlfDO5JDDjz3J6M5",
        "code": "",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "mpXQLamBkXuYHIdN1eQDo",
        "code": "",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "TZgO0MlfDO5JDDjz3J6M5"
  },
  "examples": {
    "languages": [
      {
        "id": "2gi7RY5k6e5Wm9yWQwqXC",
        "code": "curl --request POST\n  --url https://api.senseofspace.io/ConversionApi\n  --header 'Accept: application/json'\n  --data-raw '{\n    \"u\":\"my_user_name\",\n    \"p\":\"my_very_secret_pass\",\n    \"action\":\"remove_streamable_asset\",\n    \"assest_id\":\"48e99d92300cd0911602999668f54f23a5d32ef8\"\n  }'",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "2gi7RY5k6e5Wm9yWQwqXC"
  },
  "description": "Removes the hosted streamable asset files and marks the entry as hidden.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::



# Get streamable asset list

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://api.senseofspace.io/ConversionApi",
  "name": "get_streamable_assets",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "kind": "required",
        "name": "action",
        "type": "string",
        "description": "Set this to \"get_streamable_assets\""
      },
      {
        "kind": "required",
        "name": "p",
        "type": "string",
        "description": "Password"
      },
      {
        "kind": "required",
        "name": "u",
        "type": "string",
        "description": "Username"
      },
      {
        "kind": "optional",
        "name": "get_hidden",
        "type": "Boolean",
        "description": "true or false to get hidden assets or not (optional, default false)"
      }
    ],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "SUrQJ45t_JCnGoGjUHh9F",
        "code": "[\n  {\n    \"Hidden\": false,\n    \"AssetID\": \"48e99d92300cd0911602999668f54f23a5d32ef8\",\n    \"AssetName\": \"room\",\n    \"UserName\": \"my_user\",\n    \"Status\": \"ready\",\n    \"Progress\": \"\",\n    \"LastModified\": 1651835394619,\n    \"PolygonCount\": 5294,\n    \"FileSize\": 5470352,\n    \"Billed\": false\n  },\n  {\n    \"Hidden\": false,\n    \"AssetID\": \"aef9543ac1781e7543351d4c94fd756f4c391190\",\n    \"AssetName\": \"building\",\n    \"UserName\": \"my_user\",\n    \"Status\": \"ready\",\n    \"Progress\": \"\",\n    \"LastModified\": 1652167890336,\n    \"PolygonCount\": 5294,\n    \"FileSize\": 5470352,\n    \"Billed\": false\n  }\n]",
        "language": "200",
        "customLabel": ""
      },
      {
        "id": "VU274mgmBuD2T7lXxc0WY",
        "code": "",
        "language": "400",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "SUrQJ45t_JCnGoGjUHh9F"
  },
  "examples": {
    "languages": [
      {
        "id": "ELbKxY16ISViPJjyApoIl",
        "code": "curl --request POST\n  --url https://api.senseofspace.io/ConversionApi\n  --header 'Accept: application/json'\n  --data-raw '{\n    \"u\":\"my_user_name\",\n    \"p\":\"my_very_secret_pass\",\n    \"action\":\"get_streamable_assets\"\n  }'",
        "language": "curl",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "ELbKxY16ISViPJjyApoIl"
  },
  "description": "Returns a list of all your streamable assets and their details as an array of objects in JSON string format.",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

