Salesforce

Library APIs

« Go Back
Information
Library APIs
000004263
Public
Product Selection
aiWare - aiWare
Article Details

Use these APIs to manage library queries.

Get entity info

Retrieves information about an entity.

Example

query getEntityInfo {
  entity(id: "02de18d5-4f70-450c-9716-de949668ec40") {
    name
    jsondata
  }
}

Get unpublished entities in library

Retrieves information about unpublished entities in a library.

Example

query unpublishedEntities {
  entities(libraryIds: "ffd171b9-d493-41fa-86f1-4e02dd769e73", isPublished: false, limit: 1000) {
    count
    records {
      name
      id
    }
  }
}

Publish/train library

Publishes/trains a library.

Example

mutation publishLibrary {
  publishLibrary(id: "169f5db0-1464-48b2-b5e1-59fe5c9db7d9") {
    name
  }
}

Get library training stats

Retrieves the trainJobId value for an engine model (e.g. "Machine Box Facebox Similarity")

Example

query getTrainJobID {
  library(id: "1776029a-8447-406a-91bc-2402bf33443b") {
    engineModels {
      records {
        id
        createdDateTime
        modifiedDateTime
        engine {
          id
          name
        }
        libraryVersion
        trainStatus
        trainJobId
      }
    }
  }
}

Use trainJobId value to obtain train job details

Retrieves train object details with the trainJobId.

Example

query getTrainJobDetails {
  job(id: "18104324_t5XpqlGOfm") {
    tasks {
      records {
        id
        status
        startedDateTime
        completedDateTime
      }
    }
  }
}

Check if engine is library-trainable

Checks if an engine is library-trainable.

Example

query engineLibraryTrainable {
  engine(id: "95d62ae8-edc2-4fb9-ad08-fe33646f0ece") {
    libraryRequired
  }
}

Run library-enabled engine job (e.g., face recognition)

Runs a library-enabled engine job. For example, for a face recognition job.

[Note] To obtain the libraryEngineModelId, run the Get Library Training Stats query in the Library APIs topic.

Example

mutation runLibraryEngineJob {
  createJob(input: {
    targetId: "119586271"
    tasks: [
      {
        engineId: "0744df88-6274-490e-b02f-107cae03d991"
        payload: {
          libraryId: "ef8c7263-6c7c-4b8f-9cb5-93784e3d89f5"
          libraryEngineModelId: "5750ca7e-8c4a-4ca4-b9f9-df8617032bd4"
        },
      }
      ]
    }) {
    id
    targetId
    tasks {
      records {
        id
        engineId
        order
        payload
        status
      }
    }
  }
}

Update entity thumbnail in library

Updates an entity thumbnail in the library. First, obtain the URL for the entity's first identifier:

Example

query getEntityImageURL {
  entity(id: "3fd506ec-aa31-43b3-b51e-5881a57965a1") {
    identifiers(limit: 1) {
      records {
        url
      }
    }
  }
}

Then pass the identifier's URL in as the value of profileImageUrl:

Example

mutation updateEntityThumbnail {
  updateEntity(input: {
    id: "3fd506ec-aa31-43b3-b51e-5881a57965a1",
    profileImageUrl: "https://apod.nasa.gov/apod/image/2305/SunSpotBridge_Johnston_960.jpg"
  }) {
    id
    profileImageUrl
  }
}

More API examples

Additional Technical Documentation Information
Properties
8/26/2024 10:04 PM
8/26/2024 10:05 PM
8/26/2024 10:05 PM
Documentation
Documentation
000004263
Translation Information
English

Powered by