How to Take Full Advantage of CGAPI

hi everyone this is Sarah McKenna from

sequentum thank you for joining our

webinar today on how to embed data


capabilities into your operation via API

um we have our Engineers XI Jiang here

today to do a walk through of our API

and to talk through

the process flow and how it would work

to embed our system in yours with that

I'm going to pass it over to him

hi guys welcome to a webinar on API

access for Content Grabber Enterprise

Edition I think the most important thing

that we should go over first is setting

up a

uthentication token in order to start

using our API

so then under your organization first

head over to organization and click on


for one of our users over here jevin we

can set up API access under his account

I've already set one up beforehand that

expires uh

tomorrow but up from here if you want to

add a new access token you can just

press add new access token set up an

expiration date and maybe a description

if you want to but we have already set

up a

pair token that we would need to use for

every single one of our requests

so going back to our API uh the second

most important thing to do from here is

to get Asian details in order to get a

basically an agent ID for all of your

agents so in our repository over here if

we head back to repository you can see

that we have a couple agents here set up

uh Amazon I think I'm going to be using

uh either the Amazon us demo or the

Victoria's Secret one so that in order

to get the agent ID and start using our

API I'm just going to head over to my

editor over here and uh

basically for the API call I think it

was yep API agent agent path so all we

need to do is specify the agent path in

our request in order to get a

the agent ID back in our example

response over here so then we can also

do this uh like via python or a postman

uh I'm first just going to do it quickly

using like a python request and then for

the rest of them I'll probably just be

using Postman because it's actually


okay so then from here we can just uh

import our requests

um set up a URL which is

one that we're currently using is

ECC demo that's so API

agent and then we specify our agent path

the agent path is just the root

directory which is retail over here

slash whichever agent that you want uh

to get the ID for

so then from here we'll specify retail

slash probably Victoria's Secrets

is that paste that in

uh set up a body that could be blank for

now set up our headers which is uh

our authorization token


come back over here I actually did not

save the token I mean copy it


and copy this token

and then we can

set up the response

Quest Dot



set up the URL the headers

then uh the body

and then we can just print the response

from here

oops that's spelled oops will responds

wrong up here

response yep

run this

and then you can see that uh the agent

ID the name the directory ID and some of

the description for the agent actually

gets returned all of these can actually

be found in

the web portal over here like scrape

agent ID but we can also do this in

Postman as well if we want to get ID for

a specific agent like uh

retail slash Victorious

Victoria Secrets

this also works so then basically the

agent ID is our first endpoint into

every other request that we have here so

in after we have

the agent ID we can actually start up

one of the agents so then from over here

uh if I go back to the API in order to

start up an agent all we need is the

agent ID in order to start it up

um in the body a lot of these options

are actually optional so then you won't

you won't actually need them

four like some simple simple requests

like log logging level production runs

input parameters we have any

but for uh for now which is gonna enter

in agent ID

uh have the content type equals

application.json authorization with the

bearer token and then I guess one level

logging and then we can press send

you can see that uh the status here

is a 2-2 which means it has started so

from here we can check

our agent Victoria's Secrets you can see

that has actually started running

history it takes a couple seconds to run

so it's looks like it already completed

from here so from here you can actually

like download the data view the I'm not

exactly sure what this agent does again

but here I can just open up the data to

see uh what it's actually doing

oops close this

looks like we're just capturing some ID

in one of the particular fields

okay so from here uh there's a lot of

use cases for our API and one of the

biggest ones and most frequent one is

running an agent via ad hoc where

an end user will pass in a couple of

input parameters for the agent to run

and four different runs there might be

different input parameters associated

with that run so then here I've set up

an agent that actually uses an input


and the input files here it's called

Amazon us demo

from here uh if you go click on input

data you can see that there are actually

no input data currently for the agent so

then we will actually need to upload an

uh upload a input file for the agent run

so first uh

under my input.text I will set up a

specific URL to scrape from Amazon

I had one page open yeah this one I

guess we'll scrape some chocolate so I'm

just going to copy this URL

come back to my text file

paste it in here so for this agent I

guess right now it's just only gonna

script from one particular

page it's chocolate page press save now

on the postman if I want to

actually come back to API first

uploading so this is all online on

Postman and under our documentations so

then you guys can all follow along if

you want to it's under uh

this Postman link is also you can also

come here directly from uh send desk

help manual as well

but right now what we want to do is uh

want to upload agent input files in

order for uh the agent to run with these

input files

so if I come back to a postman over here

if I want to upload it

I want to upload agent file all I need

is uh the agent ID

again so from here


this is the right agent ID

let me get the agent ID for the Amazon

one instead of the Victoria's Secrets



Amazon us demo

copy this

copy the agent ID

then from here set up the authorization

and then in the body here

we can select our particular files that

we want to use I think my files

currently saved under on my desktop the

one that I just saved open that up

I can press send

so status here is a 202. so if I come

back over here to my Asian directory if

I go to Amazon device demo and then I

navigate to input data you can see that

an input file has actually been uploaded

to the agent from here I can edit it or

download it for right now I'm just going

to check it out

and it seems like yeah it has uploaded

the chocolate URL

so I can actually start up this agent to

run with that input

so from here if I start the agent again

this one here I need to change the agent


the agent actually ran with that

particular input file so if I come back

to us agent

see that's currently running and if I go

to agent run history

instead just completed successfully

right now and from here I can download

the data

uh no one wants to buy that


you can see that uh the agent scrape

this particular link got some additional

Fields such as like price and so forth

accounts but now there are some

instances where you will want to run the

agent via API like a different set of

inputs so in this case all you need to

do is just uh edit your input for like a

different page so say from here if we

want to

get some maybe laptops or something

like uh let's get the first one

copy this link and then save it directly

into our input

and then in Postman upload the new one

this is still the same file all we did

was uh change the content in the file

upload the new file

and then start up the agent again

you see that agent is running currently

going to ship it relatively quick

complete it now if I download this data

you can see that now it's scraped from

the new URL this laptop Bluetooth


and yep that's how we would go about

uploading different input files for you

guys to run via ad hoc

and then there's some cases where uh you

will actually also want to download the

data itself directly as well instead of

downloading directly from the portal you

can download via API

so from this we have

a download data specific

get data specific agent run yep from

here all we need is the agent run ID

this agent run ID is generated whenever

we run an agent

which is under when I started the agent

this run here had this ID so I'm going

to copy this ID

copy that under download data

paste that in there the authorization

token is good

that is how we will go about uh

using our internal API to set some jobs


so we went over a starting an agent I

mean getting a setting up the

authorization token getting agent

details starting an agent uploading

input files for the agent to run

updating those input files and then also


the data afterwards

we still have a lot of other

API calls in here as well

I don't think any of them are that

important to go over on this webinar

but I mean if anyone sees anyone that

they think is important that they want

me to go over I could go over them but

are there any particular questions right

now regarding

this API

I don't see any questions I do see a

number of people are still on the call

um if any of you have any particular

questions about how to embed

this data collection engine into your

system please do raise them now

otherwise you can feel free to email us

at sales

with any questions following this

webinar in your uh you can always access

our manual as well

um thank you for joining our webinar

today and we look forward to

um to hearing from you