Inputs API

Inputs API is used to manage input configuration of a particular agent. Use this API to add input url, attach a list or source agent reference in an agent input.

Get agent input by agent id

This API fetches the agent input by given agent id.

Endpoint:

Method: GET
URL: https://api.agenty.com/v1/inputs/{{AGENT_ID}}

Headers:

Key Value Description
Content-Type application/json

Query params:

Key Value Description
apikey {{API_KEY}}

Responses:

Status: OK | Code: 200

{
    "type": "MANUAL",    
    "data": [
        "http://books.toscrape.com/",
        "http://books.toscrape.com/catalogue/page-2.html",
        "http://books.toscrape.com/catalogue/page-3.html"
    ],
    "reference": null
}

Attach a list in agent input

This API will attach a list to given agent id.

Endpoint:

Method: PUT
URL: https://api.agenty.com/v1/inputs/{{AGENT_ID}}

Headers:

Key Value Description
Content-Type application/json

Query params:

Key Value Description
apikey {{API_KEY}}

Body:

{
    "type": "LIST",
    "reference": {
        "id": "72",
        "field": "Field1",
        "collection": null
    },
    "data": null
}

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "Agent input settings updated successfully"
}

Attach source agent in agent input

This API will attach the source agent reference in input for given agent id

Endpoint:

Method: PUT
URL: https://api.agenty.com/v1/inputs/dg4ely7e9r

Headers:

Key Value Description
Content-Type application/json

Query params:

Key Value Description
apikey {{API_KEY}}

Body:

{
    "type": "AGENT",
    "reference": {
        "id": "7229mv10op",
        "field": "DETAILS_PAGE_URL",
        "collection": 1
    },
    "data": null
}

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "Agent input settings updated successfully"
}

Attach manual urls in agent input

This API will overwrite the manual URLs in agent input.

Endpoint:

Method: PUT
URL: https://api.agenty.com/v1/inputs/{{AGENT_ID}}

Headers:

Key Value Description
Content-Type application/json

Query params:

Key Value Description
apikey {{API_KEY}}

Body:

{
    "type": "MANUAL",
    "data": [
        "http://books.toscrape.com/",
        "http://books.toscrape.com/catalogue/page-2.html",
        "http://books.toscrape.com/catalogue/page-3.html",
        "http://books.toscrape.com/catalogue/page-4.html",
        "http://books.toscrape.com/catalogue/page-5.html"
    ]
}

Responses:

Status: OK | Code: 200

{
    "status_code": 200,
    "message": "5 manual input updated successfully"
}