Sample Functions Using API

Function - AddCustomerRecord.py

from src.collager.util import DSApi


 def _handle(parameter):
    className = "shared.common.customer"
    entity = {
        "name": "Sam",
        "email": "sam@gmail.com",
        "address": "45, park view, NY",
        "phoneNumber": "+16463704660"
    }
    res = DSApi.save(className, entity)
    return res

Function - UpdateCustomerAddress.py

from src.collager.util import DSApi


def _handle(parameter):
    className = "shared.common.customer"
    id = "1"
    attrName = "address"
    value = "7, woodland street, NY"
    res = DSApi.update(className, id, attrName, value)
    return res

Last updated