Creating a Factory

A factory has a name and references a specific storage location using the store ID. Use the following curl command to create a factory through the API:

curl --location --request POST 'https://api.cloud.telestream.net/transform/v1.0/factories' \
--header 'X-Api-Key: tcs_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
   "name":"factory123",
   "output_store_id":"YOUR_STORE_ID"
}'

Remember to replace tcs_YOUR_API_KEY and YOUR_STORE_ID with real values. If the command fails add the -v (verbose) flag to get more error information.

If the command succeed the response will contain the ID of the new factory. You will need the identifier to submit a job to that factory or list existing jobs.

{
  "account_id": "YOUR_ACCOUNT_ID",
  "created_at": "2020-08-20T09:16:52.176109+02:00",
  "updated_at": "2020-08-20T09:16:52.176109+02:00",
  "id": "FACTORY_ID",
  "name": "factory123",
  "output_store_id": "YOUR_STORE_ID"
}

Use the following command to list the factories in your account:

curl -H 'X-Api-Key: tcs_YOUR_API_KEY' https://api.cloud.telestream.net/transform/v1.0/factories

If the command is successful the response will be similar to the following:

{
  "factories": [
    {
      "account_id": "YOUR_ACCOUNT_ID",
      "created_at": "2021-02-25T20:49:09Z",
      "updated_at": "2021-02-25T20:49:09Z",
      "id": "FACTORY_ID",
      "name": "factory123",
      "output_store_id": "YOUR_STORE_ID"
    }
  ],
  "page": 1,
  "page_count": 1,
  "per_page": 30,
  "total_count": 2
}