APIs & Integrations

RKOSURI
Participant

Regarding ContactList V3 API endpoint with out asking for ILS list ID

SOLVE

Hi Everyone, 

 I am using contactList V1 in my app and now upgrading to V3. One of the major requirement of my app is to fetch all contactlists in the hubspot account and show them to the users. To do so, I am looking for a contactlist endpoint where it wont ask for ILS list ID in request. But most of the V3 contactlists endpoints has "ILS list ID" as mandatory fields. In my requirement, i dont know anything about how many lists exists and what are their ILS list ID's. Could you please let me know is there any endpoint in contactList V3 where i can fetch all contactlists in the account? 
This is the endpoint I am looking at the moment
https://developers.hubspot.com/docs/api/crm/lists

0 Upvotes
1 Accepted solution
Jaycee_Lewis
Solution
Community Manager
Community Manager

Regarding ContactList V3 API endpoint with out asking for ILS list ID

SOLVE

Hey, @RKOSURI  👋 It looks like there are some required fields for the Search API — Lists, that shouldn't be marked that way. I'll make a request to get that updated. I have a list from 2022 (pre-dating list ILS) and it was returned with the expected ILS in the response. Here's what I did:

  • I used Postman, as the dev doc page has ListID set as required for the search endpoint (incorrectly)
  • This is the endpoint — POST /crm/v3/lists/search
  • If you want all lists returned, you can send the request with only the `processingTypes` set in the body
  • If you want to filter by list type, list name, or both, you can include this in the request body:
    Example (query is for the list title, if you intend to filter that way)
    {
     "query": "HubSpot",
     "processingTypes": ["MANUAL"]
    }​
  • In my case, I wanted to return only lists that are Active lists:
    Request
    POST https://api.hubapi.com/crm/v3/lists/search​

    Body
    {
        "processingTypes": [
            "DYNAMIC"
        ]
    }​

    Response
    {
        "offset": 20,
        "hasMore": true,
        "lists": [
            {
                "listId": "9",
                "listVersion": 1,
                "createdAt": "2022-08-17T16:47:35.714Z",
                "updatedAt": "2024-05-22T05:40:01.885Z",
                "filtersUpdatedAt": "2022-08-17T16:47:35.714Z",
                "processingStatus": "COMPLETE",
                "createdById": "10233975",
                "processingType": "DYNAMIC",
                "objectTypeId": "0-1",
                "name": "Testerr-1",
                "additionalProperties": {
                    "hs_list_reference_count": "0",
                    "hs_list_size": "1",
                    "hs_last_record_added_at": "1660754866212"
                }
            }...​

    Screenshot showing the ID returned in the response is the ILS
    CleanShot 2024-06-17 at 11.11.23@2x.png

I hope this helps get you moving forward! — Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

View solution in original post

3 Replies 3
RKOSURI
Participant

Regarding ContactList V3 API endpoint with out asking for ILS list ID

SOLVE

@Jaycee_Lewis  Thank you very much. yeah, it worked out. Quick suggestion if you dont mind. Not only for this search endpoint in lists API, there are places where the * (mandatory) sign in parameters section misleading the developers who are consuming this API. So far i have assumed like, * are mandatory fields and spend good amount of time on how to get the listIds. I realised, it is not a mandatory field after your post. Could you send this feedback to devs , so that the swagger will gets updated. 

RKOSURI_0-1718710238497.png

 

 

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Regarding ContactList V3 API endpoint with out asking for ILS list ID

SOLVE

Hey, @RKOSURI 👋 I'm happy to do that. I also noticed it has `additional properties` set as required too. I'll make that request to the dev docs team. Have a fantastic day! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Jaycee_Lewis
Solution
Community Manager
Community Manager

Regarding ContactList V3 API endpoint with out asking for ILS list ID

SOLVE

Hey, @RKOSURI  👋 It looks like there are some required fields for the Search API — Lists, that shouldn't be marked that way. I'll make a request to get that updated. I have a list from 2022 (pre-dating list ILS) and it was returned with the expected ILS in the response. Here's what I did:

  • I used Postman, as the dev doc page has ListID set as required for the search endpoint (incorrectly)
  • This is the endpoint — POST /crm/v3/lists/search
  • If you want all lists returned, you can send the request with only the `processingTypes` set in the body
  • If you want to filter by list type, list name, or both, you can include this in the request body:
    Example (query is for the list title, if you intend to filter that way)
    {
     "query": "HubSpot",
     "processingTypes": ["MANUAL"]
    }​
  • In my case, I wanted to return only lists that are Active lists:
    Request
    POST https://api.hubapi.com/crm/v3/lists/search​

    Body
    {
        "processingTypes": [
            "DYNAMIC"
        ]
    }​

    Response
    {
        "offset": 20,
        "hasMore": true,
        "lists": [
            {
                "listId": "9",
                "listVersion": 1,
                "createdAt": "2022-08-17T16:47:35.714Z",
                "updatedAt": "2024-05-22T05:40:01.885Z",
                "filtersUpdatedAt": "2022-08-17T16:47:35.714Z",
                "processingStatus": "COMPLETE",
                "createdById": "10233975",
                "processingType": "DYNAMIC",
                "objectTypeId": "0-1",
                "name": "Testerr-1",
                "additionalProperties": {
                    "hs_list_reference_count": "0",
                    "hs_list_size": "1",
                    "hs_last_record_added_at": "1660754866212"
                }
            }...​

    Screenshot showing the ID returned in the response is the ILS
    CleanShot 2024-06-17 at 11.11.23@2x.png

I hope this helps get you moving forward! — Jaycee

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot