Salesforce

Queries for brand safety results

« Go Back
Information
Queries for brand safety results
000004348
Public
Product Selection
aiWare - aiWare
Article Details

After starting a job with the createJob mutation, you will need to monitor its progress with GraphQL queries. Once the job is complete, you will then retrieve references to the documents containing the job results.

For the previous steps, see the brand safety job example for Brand safety engines.

Query for the job status

Using the target ID from the createJob mutation, query for the job status. Run this periodically until the job status changes to complete.

GraphQL query:

query getJobs($tdoId: ID!) {
  jobs(targetId: $tdoId) {
    count
    records {
      id
      createdDateTime
      status
      targetId
      clusterId
      tasks {
        records {
          id
          status
          startedDateTime
          completedDateTime
          engine {
            id
            name
          }
        }
      }
    }
  }
}

GraphQL example variables for this query:

{
  "tdoId": "1951002277"
}

GraphQL response:

{
  "data": {
    "jobs": {
      "count": 1,
      "records": [
        {
          "id": "22030903_Gq1GRNdmwc",
          "createdDateTime": "2022-03-03T19:36:41.000Z",
          "status": "complete",
          "targetId": "1951002277",
          "clusterId": "prd5-21xbyq0x-4h0s-o685-snas-oovhdai552v9",
          "tasks": {
            "records": [
              {
                "id": "22030903_Gq1GRNdmwcjGtML",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:38:47.000Z",
                "completedDateTime": "2022-03-03T19:43:59.000Z",
                "engine": {
                  "id": "8eccf9cc-6b6d-4d7d-8cb3-7ebf4950c5f3",
                  "name": "Writer: TDO Asset",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcLKeLQ",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:36:58.000Z",
                "completedDateTime": "2022-03-03T19:42:26.000Z",
                "engine": {
                  "id": "8bdb0e3b-ff28-4f6e-a3ba-887bd06e6440",
                  "name": "Ingestor (Stream): Chunk Creator",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcVVjvt",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:38:32.000Z",
                "completedDateTime": "2022-03-03T19:38:38.000Z",
                "engine": {
                  "id": "cb2b77b9-3478-4e51-844f-e4064384bb33",
                  "name": "Entity Extraction - G V3",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcj0ZKD",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:38:07.000Z",
                "completedDateTime": "2022-03-03T19:38:09.000Z",
                "engine": {
                  "id": "8eccf9cc-6b6d-4d7d-8cb3-7ebf4950c5f3",
                  "name": "Writer: TDO Asset",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcIxxW1",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:37:59.000Z",
                "completedDateTime": "2022-03-03T19:38:00.000Z",
                "engine": {
                  "id": "06bbc2e7-aa59-4c32-9ec3-1a147fff78a6",
                  "name": "eContext Classify (IAB) V3",
                
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcik7w9",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:37:51.000Z",
                "completedDateTime": "2022-03-03T19:37:53.000Z",
                "engine": {
                  "id": "045e675b-ed7c-43bf-8300-a2f2102f57a4",
                  "name": "Chunk Aggregator",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcZMKTn",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:37:48.000Z",
                "completedDateTime": "2022-03-03T19:37:49.000Z",
                "engine": {
                  "id": "8eccf9cc-6b6d-4d7d-8cb3-7ebf4950c5f3",
                  "name": "Writer: TDO Asset",
                }
              },
              {
                "id": "22030903_Gq1GRNdmwcYGMpi",
                "status": "complete",
                "startedDateTime": "2022-03-03T19:37:05.000Z",
                "completedDateTime": "2022-03-03T19:37:43.000Z",
                "engine": {
                  "id": "c0e55cde-340b-44d7-bb42-2e0d65e98255",
                  "name": "Transcription E: English (Global)",
                }
              }
            ]
          }
        }
      ]
    }
  }
}

Query for the result assets

Using the same target ID as above, query for assets that were created as a result of the job. These assets will reference the result documents using signed URLs.

GraphQL query:

query getAssets(
  $tdoId:ID!
) {
  temporalDataObject(id: $tdoId) {
    assets(assetType: "vtn-standard") {
      count
      records {
        sourceData {
          engine {
            id
            name
          }
        }        
        id
        createdDateTime
        assetType
        name
        signedUri
      }
    }
  }
}

GraphQL example variables for the query:

{
  "tdoId": "1951002277"
}

GraphQL response:

{
   "data": {
     "temporalDataObject": {
       "assets": {
         "count": 3,
         "records": [
           {
            "sourceData": {
               "engine": {
                 "id": "cb2b77b9-3478-4e51-844f-e4064384bb33",
                 "name": "Entity Extraction - G V3"
               }
             },
             "id": "1951002277_Ck7X83Y1Z7",
             "createdDateTime": "2022-03-03T19:38:47.000Z",
             "assetType": "vtn-standard",
             "name": null,
             "signedUri": "https://s3.amazonaws.com/prod-api.veritone.com/37587/other/2022/2/4/_/19-46-678_ec512543-0cfa-4a5b-8065-e9aea0f02627?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQMR5VATUHU3MEGOA%2F20220303%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220303T203107Z&X-Amz-Expires=86400&X-Amz-Signature=3ec5aae8740ff3d98ec1861f262047a0d45ad2708a5b4b944102d437d440ba96&X-Amz-SignedHeaders=host"
           },
           {
             "sourceData": {
               "engine": {
                 "id": "06bbc2e7-aa59-4c32-9ec3-1a147fff78a6",
                 "name": "eContext Classify (IAB) V3"
               }
             },
             "id": "1951002277_MX9NEpSB6S",
             "createdDateTime": "2022-03-03T19:38:07.000Z",
             "assetType": "vtn-standard",
             "name": null,
             "signedUri": "https://s3.amazonaws.com/prod-api.veritone.com/37587/other/2022/2/4/_/19-6-503_187db820-9e9e-4a14-ab97-253c46d3bf2a?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQMR5VATUHU3MEGOA%2F20220303%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220303T203107Z&X-Amz-Expires=86400&X-Amz-Signature=d3f0be7f1006fc316876fbb7d5763a0a452c7ffda0c99b9d371e6770fd5cb8aa&X-Amz-SignedHeaders=host"
           },
           {
             "sourceData": {
               "engine": {
                 "id": "c0e55cde-340b-44d7-bb42-2e0d65e98255",
                 "name": "Transcription E: English (Global)"
               }
             },
             "id": "1951002277_ESI74f3fs1",
             "createdDateTime": "2022-03-03T19:37:48.000Z",
             "assetType": "vtn-standard",
             "name": null,
             "signedUri": "https://s3.amazonaws.com/prod-api.veritone.com/37587/other/2022/2/4/_/19-48-151_74b18e82-5864-4582-b8b5-211c45a18ec5?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQMR5VATUHU3MEGOA%2F20220303%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220303T203107Z&X-Amz-Expires=86400&X-Amz-Signature=529349c8fd3899534742e6b07f99f1693ec83139929b60226f25b20be1086a12&X-Amz-SignedHeaders=host"
           }
         ]
       }
     }
   }
}
Additional Technical Documentation Information
Properties
1/3/2024 11:12 PM
1/3/2024 11:13 PM
1/3/2024 11:13 PM
Documentation
Documentation
000004348
Translation Information
English

Powered by