LeadSquared Developer Centre

ON THIS PAGE

Get Products


Returns multiple products and their details. The API lets you retrieve products based on the parameter and value you pass. You can use this API –

  • To retrieve products based on search text, in which case you have to pass the “Parameter” as “SearchText” and enter corresponding text to search by. You can enter text matching the product SKU, name or description.
  • To retrieve products by specifying other parameters like “Id”, “ProductSku” or “Name” and passing the corresponding values.

API URL

URL
Icon
POST https://{host}/v2/SalesActivity.svc/RetrieveProducts?accessKey=AccessKey&secretKey=SecretKey

Request

Content-Type: application/json
JSON Body/Payload Icon
{
    "Parameter": {
        "SearchText": "Product"
    },
    "Sorting": {
        "ColumnName": "ModifiedOn",
        "Direction": "1"
    },
    "Paging": {
        "PageIndex": 1,
        "PageSize": 10
    }
}

Request Parameters

Parameter Description
SearchText

This is search term, example:- If you want all the products which has text mobile then  “SearchText”: “Mobile”

ColumnName

The name of the column you want to sort the results by.

Direction

Passing “1” will sort the data most recent first while “0” will sort oldest first.

PageIndex

Refers to the page number (“1” represents the first page).

PageSize

Refers to the number of records to be displayed.

Response

200 OK
Content-Type: application/json
{
    "RecordCount": 3,
    "List": [
        {
            "ProductId": "1202e919-5dcd-dfgdf2000a9700b4",
            "ProductSku": "Product#01",
            "Name": "API Product",
            "Description": "API Product",
            "CreatedBy": "6ba64831-b1c1-11fdgfg00a9700b4",
            "CreatedByName": "rizwan ali",
            "CreatedOn": "2015-09-18 06:18:25",
            "ModifiedBy": "6ba64831-b1c1-gdfg22000a9700b4",
            "ModifiedByName": "rizwan ali",
            "ModifiedOn": "2015-09-18 06:20:04"
        },
        {
            "ProductId": "fce5c7f6-cc95-1dfgdfb-22000a9700b4",
            "ProductSku": "pro-22",
            "Name": "product 2",
            "Description": "Description/Notes",
            "CreatedBy": "6ba64831-b1c1-11e4-981b-22000a9700b4",
            "CreatedByName": "rizwan ali",
            "CreatedOn": "2015-03-17 11:08:49",
            "ModifiedBy": "6ba64831-bfdfg-22000a9700b4",
            "ModifiedByName": "rizwan ali",
            "ModifiedOn": "2015-03-17 11:08:49"
        },
        {
            "ProductId": "a37e7042-cc95ddf000a9700b4",
            "ProductSku": "pro-11",
            "Name": "Demo Product",
            "Description": "Description/Notes",
            "CreatedBy": "6ba64831-bdfgf1b-22000a9700b4",
            "CreatedByName": "rizwan ali",
            "CreatedOn": "2015-03-17 11:06:19",
            "ModifiedBy": "6ba64831fdgx1b-22000a9700b4",
            "ModifiedByName": "rizwan ali",
            "ModifiedOn": "2015-03-17 11:06:19"
        }
    ]
}

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

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