> For the complete documentation index, see [llms.txt](https://docs.targetpick.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.targetpick.io/targetpick_eng/for-ssp/report-api/native.md).

# Native

{% hint style="info" %}
SSP :arrow\_right: DSP
{% endhint %}

This document is an API guide for providing reports to SSP (Supply Side Platform) partners integrated with TARGETPICK DSP (Demand Side Platform).&#x20;

To receive DSP reports from TARGETPICK, you must obtain a Token from the CJ MezzoMedia manager before use. Please contact the designated manager to issue a Token for API use.

## 1. Report Data Request <a href="#report-data-request" id="report-data-request"></a>

| Information           | Description                                        |
| --------------------- | -------------------------------------------------- |
| Service API Name      | SSP-provided report data                           |
| API response type     | XML or JSON                                        |
| Authentication method | Token                                              |
| Method                | HTTPS                                              |
| API description       | Delivers report results for ads served on the SSP. |

### **URL**

<table><thead><tr><th width="130">Environment</th><th width="500">URL</th><th>Method</th></tr></thead><tbody><tr><td>Test</td><td>http://211.62.152.212:9000/api/report</td><td>Get</td></tr><tr><td>Production</td><td>https://dsp-report.meba.kr:9000/api/report</td><td>Get</td></tr></tbody></table>

### **Parameters**

<table><thead><tr><th>Field</th><th width="149">Type</th><th>Required</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>sDate</td><td>String</td><td>Y</td><td>Report query start date</td><td>20160101</td></tr><tr><td>eDate</td><td>String</td><td>Y</td><td>Report query end date</td><td>20160131</td></tr><tr><td>PartnerID</td><td>String</td><td>Y</td><td>Partner unique ID issued by MezzoMedia</td><td>userpartnerid</td></tr><tr><td>Token</td><td>String</td><td>Y</td><td>Partner-specific Token value for API use</td><td>F379C8K9P0</td></tr><tr><td>ADType</td><td>Integer</td><td>Y</td><td><ul><li>0: All</li><li>10: native</li></ul></td><td>10</td></tr><tr><td>ReportType</td><td>Integer</td><td>Y</td><td><ul><li>1: daily report</li><li>2: media (PubID) report</li><li>3: ad type report</li></ul></td><td>1</td></tr><tr><td>format</td><td>String</td><td>Y</td><td>json , xml</td><td>json</td></tr></tbody></table>

### **Sample**

| Sample URL                                                                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <http://211.62.152.212:9000/api/report?PartnerID=abcde12345\\&token=C150KPTR39F0277A743B6\\&format=xml\\&ReportType=1\\&ADType=0\\&sDate=20190101\\&eDate=20190131> |

## 2. Report Data Response

Basic information - When a request is sent to the report API, report data is returned in the following format.

| Field      | Type    | Description                                                                                 | Example      |
| ---------- | ------- | ------------------------------------------------------------------------------------------- | ------------ |
| ListCount  | Integer | Number of rows returned in the list                                                         | 100          |
| ReportType | Integer | <ul><li>1: daily report</li><li>2: media (PubID) report</li><li>3: ad type report</li></ul> | 1            |
| Date       | String  | Reporting date                                                                              | 20160101     |
| Imp        | Integer | Impression count                                                                            | 1000         |
| Click      | Integer | Click countClick-through rate                                                               | 100          |
| CTR        | Double  | Click-through rate                                                                          | 10.00        |
| PubID      | String  | ID used to identify the media, such as AppID or SiteID (may be a random or encrypted ID)    | publisher123 |
| Revenue    | Double  | il9RrdZOYwk0                                                                                | 100000       |

### Example

{% tabs %}
{% tab title="Daily Report" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="utf-8" ?>
<data>
	<error>
		<code>000</error>
		<message>SUCCESS</message>
	</error>
	<result>
		<ListCount>10</ListCount> 
		<ReportType>1</ReportType> 
		<sDate>20190101</sDate> 
		<eDate>20190131</eDate> 
		<ADType>ALL</ADType> 
		<Reports>
			<Report>
				<Date>20190101</Date>
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR>10.00</CTR>
				<Revenue>5000</Revenue>
			</Report>
			<Report>
				……
			</Report>
		</Reports>
	</result>
</data>
```

{% endcode %}
{% endtab %}

{% tab title="media-by-PubID report" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="utf-8" ?>
<data>
	<error>
		<code>000</error>
		<message>SUCCESS</message>
	</error>
	<result>
		<ListCount>10</ListCount> 
		<ReportType>2</ReportType> 
		<sDate>20160101</sDate> 
		<eDate>20160131</eDate> 
		<ADType>banner</ADType> 
		<Reports>
			<Report>
				<Date>20160101</Date>
				<PubID>publisher123</PubID>
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR>10.00</CTR>
				<Revenue>5000</Revenue>
			</Report>
			<Report>
				<Date>20160101</Date>
				<PubID>publisher456</PubID>
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR>10.00</CTR>
				<Revenue>3000</Revenue>
			</Report>
			<Report>
				……
			</Report>
		</Reports>
	</result>
</data> xml version="1.0" encoding="utf-8" ?>
<data>
	<error>
		<code>000</error>
		<message>SUCCESS</message>
	</error>
	<result>
		<ListCount>10</ListCount> 
		<ReportType>1</ReportType> 
		<sDate>20160101</sDate> 
		<eDate>20160131</eDate> 
		<ADType>ALL</ADType> 
		<Reports>
			<Report>
				<Date>20160101</Date>
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR>10.00</CTR>
				<Revenue>5000</Revenue>
			</Report>
			<Report>
				……
			</Report>
		</Reports>
	</result>
</data>
```

{% endcode %}
{% endtab %}

{% tab title="ad type report" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="utf-8" ?>
<data>
	<error>
		<code>000</error>
		<message>SUCCESS</message>
	</error>
	<result>
		<ListCount>10</ListCount> 
		<ReportType>3</ReportType> 
		<sDate>20160101</sDate> 
		<eDate>20160131</eDate> 
		<ADType>ALL</ADType> 
		<Reports>
			<Report>
				<Date>20160101</Date>
				<ADType>banner</ADType>
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR> 10.00</CTR>
				<Revenue>5000</Revenue>
			</Report>
			<Report>
				<Date>20160101</Date>
				<ADType>interstitial</ADType> 
				<Imp>1000</Imp>
				<Click>100</Click>
				<CTR> 10.00</CTR>
				<Revenue>3000</Revenue>
			</Report>
			<Report>
				……
			</Report>
		</Reports>
	</result>
</data>
```

{% endcode %}
{% endtab %}
{% endtabs %}

## **3. Error Code**

<table><thead><tr><th width="150">Code</th><th>Descirption</th></tr></thead><tbody><tr><td>000</td><td>Success</td></tr><tr><td>001</td><td>A system error occurred.</td></tr><tr><td>002</td><td>An unknown error occurred.</td></tr><tr><td>003</td><td>You do not have permission to view this data.</td></tr><tr><td>004</td><td>This API does not exist.</td></tr><tr><td>005</td><td>Invalid parameter information.</td></tr><tr><td>006</td><td>A date must be provided and the range cannot exceed three months.</td></tr></tbody></table>

### **Example**

{% tabs %}
{% tab title="Error Response" %}
{% code lineNumbers="true" %}

```xml
<?xml version="1.0" encoding="utf-8" ?>
<data>
	<error>
		<code>000</code> 
		<message>SUCCESS</message> 
	</error>
</data>
```

{% endcode %}
{% endtab %}
{% endtabs %}
