Forum Discussion

Jk07's avatar
Jk07
Adept
2 years ago

Get All Labels using API v1 call.

How can I get all the labels in the community using the Community API v1 call?

 
  • Hi Jk07 ,

    You can get all the community labels using below APIv1 call:

    https://[Community Domain]/restapi/vc/labels?page=1&page_size=1000

    where you can change the page_size limit parameter or change the page parameter to get other labels available on other pages.

    For example, if you want to get all labels of a community having a total label count of 3800 labels then you need to hit below 4 API calls.

    https://[Community Domain]/restapi/vc/labels?page=1&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=2&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=3&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=4&page_size=1000

    Kindly give kudos and mark this as an accepted solution if this post helped you in any way.

4 Replies

  • Hi Jk07,

    You can use the following V1 API call to see the labels.

    https://[Community Domain] /restapi/vc/labels

  • Hi Jk07 ,

    You can get all the community labels using below APIv1 call:

    https://[Community Domain]/restapi/vc/labels?page=1&page_size=1000

    where you can change the page_size limit parameter or change the page parameter to get other labels available on other pages.

    For example, if you want to get all labels of a community having a total label count of 3800 labels then you need to hit below 4 API calls.

    https://[Community Domain]/restapi/vc/labels?page=1&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=2&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=3&page_size=1000
    https://[Community Domain]/restapi/vc/labels?page=4&page_size=1000

    Kindly give kudos and mark this as an accepted solution if this post helped you in any way.
  • Jk07's avatar
    Jk07
    Adept
    2 years ago

    can we give page_limit= 4000, (assume that there are 3800 labels)

  • Jk07 ,

    No, we don't have any page_limit parameter in the API, also the maximum value allowed in the page_size parameter is 1000 only. we cannot specify any greater value, although you can specify any lesser value like 500 but then pagination will be recreated and you need to hit 8 API calls for 3800 labels. so the best hit is 1000 page_size which is the maximum.