assign_batches

imerit_ango.sdk.SDK.

assign_batches(project_id, asset_ids, batches)

Assign specific asset(s) to specific batches.

Parameters

  • project_id: string

  • asset_ids: List[str]

    • List of asset IDs to assign to batches. Asset IDs can be obtained from the UI, or from get_assets.

    • Example: ['0000000aa0a00a0000aaaa0a', '0000000aa0a00a0000aaaa0b']

  • batches: List[str]

    • List of batches to which assets will be assigned.

    • You can choose to pass either a list of batch names or a list of batch IDs. Batch names and batch IDs can be obtained with get_batches.

    • Example:

      • ['Batch-1', 'Batch-2'] or

      • ['0000000aa0a00a0000aaaa0a', '0000000aa0a00a0000aaaa0b']

Returns:

  • output: dict

Example

import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

asset_ids = ['<YOUR ASSET ID 1>', '<YOUR ASSET ID 2>']
batch_ids = ['<YOUR BATCH ID 1>', '<YOUR BATCH ID 2>']

ango_sdk.assign_batches(project_id, asset_ids, batch_ids)

Outputs:

{
  "status": "success",
  "data": {
    "assets": 2
  }
}

Where "assets" is the number of assets successfully assigned to the batch(es).

Last updated