Lists API is used to manage lists under an Agenty account. You may use this API to create list, get all lists, add new rows, update rows or delete rows from a list etc.
Create a List
Endpoint:
Method: POST
URL: https://api.agenty.com/v1/lists
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
{
"name": "URLs list for fashion category",
"description": "List of products URL"
}
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "A new list with id: 70 created successfully",
"list_id": 70
}
Get List by id
Endpoint:
Method: GET
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} | Your api key |
Responses:
Status: OK | Code: 200
{
"list_id": 70,
"name": "URLs list for fashion category",
"description": "List of products URL",
"total_rows": 0,
"created_at": "2019-03-08T13:07:23",
"updated_at": null
}
Update a List by id
Endpoint:
Method: PUT
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
{
"list_id": 70,
"name": "URLs list updated on april 2019",
"description": "List of 50000 products URL"
}
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "List with id: 70 updated successfully"
}
Get all Lists
Endpoint:
Method: GET
URL: https://api.agenty.com/v1/lists
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"total": 3,
"limit": 1000,
"offset": 0,
"returned": 3,
"result": [
{
"list_id": 70,
"name": "URLs list updated on april 2019",
"description": "List of 50000 products URL",
"total_rows": 0,
"created_at": "2019-03-08T13:05:14",
"updated_at": "2019-03-08T13:08:26"
},
{
"list_id": 71,
"name": "URL list for mobile category",
"description": null,
"total_rows": 0,
"created_at": "2019-03-08T13:05:53",
"updated_at": null
},
......
]
}
Delete List by id
Endpoint:
Method: DELETE
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: OK | Code: 200
{
"status_code": 200,
"message": "List with id : 70 deleted successfully"
}
Get list rows by list id
To fetch all the rows in the given list id
Endpoint:
Method: GET
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/rows
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: Ok | Code: 200
{
"offset": 0,
"limit": 1000,
"returned": 3,
"total": 8,
"result": [
{
"_id": 1,
"col1": "https://www.domain.com/cat/1",
"col2": "mobile",
"col3": "1000",
"col4": "33"
},
{
"_id": 2,
"col1": "https://www.domain.com/cat/2",
"col2": "tablet",
"col3": "2400",
"col4": "34"
},
{
"_id": 3,
"col1": "https://www.domain.com/cat/3",
"col2": "mobile",
"col3": "1100",
"col4": "35"
},
...
]
}
Get list row by row id
To fetch a single row from a list with given id and the row id
Endpoint:
Method: GET
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/rows/{{ROW_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: Ok | Code: 200
{
"_id": 2,
"col1": "https://www.domain.com/cat/2",
"col2": "tablet",
"col3": "2400",
"col4": "34"
},
Update list row by id
To update a particular row in a list by given list id and row id
Endpoint:
Method: PUT
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/rows/{{ROW_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
{
"_id" : 11,
"col1" : "value5",
"col2" : "value6",
"col3" : "value7",
"col4" : "value8"
}
Responses:
Status: Ok | Code: 200
{
"status_code": 200,
"message": "List row with id:10 updated successfully"
}
Insert new rows to list
To bulk insert one or many rows in a list.
Endpoint:
Method: POST
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/rows
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Body:
An array of rows to insert in the list. Must have the same column names to auto-map with whatever values you want to insert in your list.
[
{
"col1" : "value1",
"col2" : "value2",
"col3" : "value3",
"col4" : "value4"
},
{
"col1" : "value1",
"col2" : "value2",
"col3" : "value3",
"col4" : "value4"
}
]
Responses:
{
"status_code": 200,
"message": "2 row(s) inserted successfully"
}
Delete list row by id
To delete a particular row in a list by given row id
Endpoint:
Method: DELETE
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/rows/{{ROW_ID}}
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
{
"status_code": 200,
"message": "List row with id:2 deleted successfully"
}
Clear a list by id
To delete all rows in a list.
Endpoint:
Method: DELETE
Type: application/json
URL: https://api.agenty.com/v1/lists/{{LIST_ID}}/clear
Query params:
Key | Value | Description |
---|---|---|
apikey | {{API_KEY}} |
Responses:
Status: Ok | Code: 200
{
"status_code": 200,
"message": "List with id: 2 cleared successfully"
}