Audience segmentation and ingestion for InMobi DSP

InMobi DSP’s (Demand-side platform) Segment Creation API enables advertisers to transfer their audience to InMobi DSP with minimal manual intervention. Data ingestion significantly improves campaign targeting by leveraging the InMobi DSP Data Science models along with your audience.

You can configure the TTL (Time-to-Live) values, which determine how long your audience data remains in the DSP.You can use the integration to target your audience positively and negatively on the InMobi DSP.

The process starts with integrating your server with InMobi DSP and creating the audience segment on the DSP. After the segment creation, you have to ingest the audience data into the DSP through the Segment Ingestion API workflow:

Segment Ingestion API Workflow

Uses a POST endpoint to transfer the bulk audience data stored in a compressed CSV file (.csv.gz) with a maximum file size of 10 MB. After completing the segment ingestion, you can target the audience through InMobi DSP. For any queries regarding the integration process, contact the InMobi team.

Pre-requisites

  • Ensure you have an active account with the InMobi DSP.
  • segmentName should not be NULL (-minLength value is 1 and -maxLength is 200).
  • Before submitting the segment creation request, ensure that the segment name doesn't include these special characters -  \ ; ) ( ' } { < > / ;.

Create Audience Segment on InMobi DSP

Before ingesting your audience segment in your InMobi DSP account, you must integrate the DSP Segment Creation API into your server. The integration automatically creates the audience segments on your DSP account.

Follow the steps to create an audience segment on InMobi DSP:

  1. Use the following API URL to start creating the audience segment on InMobi DSP:http://advertiser.inmobiapis.com/tpce/v1/segment?segmentName=&propertyId=&membershipTtl=<MEMBER_SHIP_TTL_IN_DAYS>.
  2. Replace the value of the following API parameters with the required values:
    • SEGMENT_NAME: Refers to the name of your audience segment. The value should be in all capitals with no spaces or special characters.
    • INMOBI_ADVERTISER_ID: Refers to the advertiser ID assigned to you by InMobi.
    • MEMBER_SHIP_TTL_IN_DAYS: Refers to the TTL for user IDs tagged to the audience segment. The value should be a number.
  3. Check the API response. The response should be as follows:

    {
        "status": "OK",
        "message": "success",
        "code": 200,
        "segmentId": "64d9e0bb-ad9c-4235-8b6e-2d1e6ad40cb3"
    }
    
    Value Data type Description
    OK String The API call was processed without any error.
    success String Message for successful integration.
    200 Number Refers to the HTTP status code.
    64d9e0bb-ad9c-4235-8b6e-2d1e6ad40cb3 String The ID of the segment created in the InMobi DSP
  4. Confirm with your InMobi Account Manager if the audience segment is visible on the DSP dashboard. Once created, keep a note of the Segment ID as you will need it during segment ingestion.

Note:

In addition to input sanitization, you should be aware of the following common error responses and the corresponding resolution actions:

  • VALUE.ILLEGAL_CHARS
    • Description: The segment name provided by the advertiser contains characters that are not allowed by the system.
    • Resolution: Avoid using these special characters - " \ ; ) ( ' } { < > / ;.
  • SEGMENT_NAME_ALREADY_EXISTS
    • Description: The segment name provided already exists in the system.
    • Resolution: Ask the client to choose a unique segment name.
  • ADVERTISER_NON_COMPLIANT
    • Description: The advertiser associated with the request does not meet InMobi’s compliance requirements.
    • Resolution: Ask the client to contact their InMobi Account Manager for clarification and support on advertiser onboarding or policy requirements.
  • HTTP 500
    • Description: It's an internal server error, which could be a transient backend issue.
    • Action: Retry the request. The segment creation API should succeed on a subsequent attempt.

Ingest Segment Data to InMobi DSP

After you create the audience segment on the InMobi DSP, you can ingest your audience data into the DSP through the Segment Ingestion API workflow:

Segment Ingestion API Workflow

Segment ingestion uses a POST endpoint to transfer the data stored in a compressed CSV file (.csv.gz) with a maximum file size of 10 MB. The file name format is filename.csv.gz, with no space between the words if the filename has more than one word. Follow the steps to implement the CSV file Ingestion:

  1. Use the following API for Segment ingestion of your audience data:
    curl -X POST -H 'Content-Type: multipart/form-data' -H 'Accept-Encoding: gzip' -H 'Content-Disposition: attachment; filename="@sample.csv.gz"' -H 'Content-Transfer-Encoding: binary' -F "file=@sample.csv.gz" -H 'User-Agent: python-requests/2.14.2' https://advertiser-content.inmobiapis.com/tpce/v1/upload/usersegment?propertyId=<inmobi_advertiser_id>&segmentNames=<segment_name>&segmentIds=<segment_id>&action=<action> </action></segment_ids></segment_names></inmobi_advertiser_id>
    
  2. Replace the following API parameters with the required values:
    • INMOBI_ADVERTISER_ID: Refers to the advertiser ID assigned to you by InMobi.
    • SEGMENT_NAMES: Refers to the segment name (one segment per request) you wish to update.
    • SEGMENT_IDS: Refers to the segment ID when you create an audience segment on InMobi DSP.
    • ACTION: Helps to add or delete the data from the InMobi DSP. Enter add or delete based on the requirement.
  3. Check the file ingestion API response. The response should be as follows:

    {
        "status": "OK",
        "message": "check the jobStatus via GET call of given jobUrl",
        "code": 200,
        "jobUrl": "https://advertiser-content.inmobiapis.com/tpce/v1/upload/jobs/file?job_id=sample.csv.gz_j2358cd64-63c0-4d8d-8104-5812dc09a5f2"
    }        
    
    Key Value Data type Description
    status OK String The API call was processed without any error.
    message  check the jobStatus via GET call of given jobUrl String Message for checking the status of the ingestion.
    code 200 Number Refers to the https status code.
    jobUrl https://advertiser-content.inmobiapis.com/tpce/v1/upload/jobs/file?job_id=sample.csv.gz_j2358cd64-63c0-4d8d-8104-5812dc09a5f2 String The URL to check the status of a job
  4. Check the job status by clicking the jobUrl value you get in step 3.
  5. Check the job status response. The response should be as follows:
    {
        "status": "OK",
        "message": "File processed successfully",
        "code": 200,
    }           

     

    Key Value Data type Description
    status OK String The API call was processed without any error.
    message File processed successfully String Message for successful job status check.
    code 200 Number Refers to the https status code.

    Note:

    If the propertyId or advertiserId used in the segment creation or segment ingestion is not InMobi DSP compliant, you may see the following error:

    {
        "status": "BAD_REQUEST",
        "message": "Invalid parameter(s) : Rejected due to error: CVM-X",
        "code": 1001,
        "segmentId": "-1"
    }       

     

  6. Confirm with the InMobi team if the audience segment data are visible on the DSP dashboard. It takes at least 24 hours to reflect the audience data on the DSP after execution.

On This Page

Last Updated on: 18 Jul, 2025