LeadSquared Developer Centre

ON THIS PAGE

Retrieve Widget


Retrieves the LeadSquared Widget details of one or more widgets (Widget Id, Name, and Description).

For more information regarding LeadSquared Widgets, refer to this article: Capture Leads from Any Website with LeadSquared Form Widgets.

Note:

  • All request parameters are non-mandatory. If you pass an empty payload, then all the widgets available in the manage widgets page will be retrieved.
  • You must use the correct API host to make successful calls.

API URL

URL
Icon
POST https://{host}/api/Widget/Retrieve?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{
    "Parameter": {
        "SearchText": "University Widget",
        "StatusCode": 0
    },
    "Paging": {
        "PageIndex": 1,
        "PageSize": 25
    }
}

Request Parameters

Parameter Description
SearchText

Retrieves widgets based on any string you pass. The string can be the widget name or description.

StatusCode

Lets you retrieve widgets by status –

  • “0” represents unpublished widgets
  • “1” represents published widgets
PageIndex

The results matching your criteria may be large. You can fetch the result in blocks of “PageSize” and make multiple calls to the API with increasing values of “PageIndex”.  For example, you can specify “PageIndex”: 1, “PageSize”: 100 for the first call and specify “PageIndex”: 2, “PageSize”: 100 for second call.

PageSize

See PageIndex

Response

200 OK
Content-Type: application/json
{
    "TotalRecords": 1,
    "WidgetList": [
        {
            "Id": "f0600e64-56bd-11ee-9135-0a5",
            "Name": "University Widget",
            "Description": "Widgets used for Uni"
        }
    ]
}

HTTP Response Codes

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.

On this page

© 2024 by MarketXpander Services Pvt Ltd. All Rights Reserved.