Get in touch

Get in touch

Prefer using email? Say hi at hello@moveshelf.com

This section explains how to delete multiple subjects from Moveshelf using the Moveshelf API, based on the subjects' ID.
Prerequisites
Before implementing this example, ensure that your processing script includes all necessary setup steps. In particular, you should have:
Implementation
To delete multiple subjects, add the following lines of code to your processing script:
## README: this example shows how we can delete multiple subjects from Moveshelf 
# using the Moveshelf API.

# Delete multiple subjects at once
subject_ids = [
    "<subjectId_1>",
    "<subjectId_2>",
    "<subjectId_3>"
]

results = api.deleteSubjects(subject_ids)

# Check results
for subject_id, success in results.items():
    status = "SUCCESS" if success else "FAILED"
    print(f"Subject {subject_id}: {status}")

# Count successes and failures
successful = sum(results.values())
total = len(subject_ids)
print(f"Deleted {successful}/{total} subjects successfully")