Fetch customer segmentation file

This API allows the brands to poll the status of a previously initiated file generation job. If the job is complete, the API returns a downloadable link to the generated file.

GET
/api/v1/return-exchange-intelligence/customer-segmentation/customer-segment-data-file


Method: GET
Content-Type: application/json
Authentication: Via username and key as query parameters
Body: Provide job_id as JSON in the request body


StatusDescription
PENDINGFile generation is in progress
SUCCESSFile is ready and downloadable
FAILEDFile generation failed

NOTES

  • These APIs are asynchronous. You must poll using job_id until the job status becomes SUCCESS.
  • Always handle file_link = null as a signal that the job is not yet complete.
  • Do not reuse expired file_links as they are valid for 7 days only.
  • Each file generation request produces a unique file_link. If a new request is submitted, any previously generated file_link becomes invalid. Only the most recent link will remain active.

Request cURL

curl --location --request GET \
'https://www.clickpost.in/api/v1/return-exchange-intelligence/customer-segmentation/customer-segment-data-file?username=<your-enterprise-username>&key=<your-enterprise-key>' \
--header 'Content-Type: application/json' \
--data '{
  "job_id": 12345
}'

In progress response

When the job is still in progress, it returns the "Pending" status with a Success response.

{
  "meta": {
    "message": "SUCCESS",
    "success": true,
    "status": 200
  },
  "result": {
    "job_id": 12345,
    "file_link": null,
    "status": "PENDING"
  }
}

Success response

{
  "meta": {
    "message": "SUCCESS",
    "success": true,
    "status": 200
  },
  "result": {
    "job_id": 12345,
    "file_link": "https://example.com/sample_file.csv",
    "status": "SUCCESS"
  }
}

ℹ️ Note:
The file_link is a pre-signed, temporary URL valid for 7 days. You should download or persist the link before it expires


Failure response: Service Not Subscribed

When the service is not subscribed, the API will return with a status 320.

{
  "meta": {
    "status": 320,
    "message": "This service is not subscribed by you",
    "success": false
  }
}

Failure response: Invalid Job ID

{
  "meta": {
    "message": "Entity not found",
    "success": false,
    "status": 400
  }
}