Affiliate APIs | ASR Version 1.0 Limited Launch

If you would like to be kept updated on ASR and other Affiliate focused initiatives Click Here

ASR Version 1.0 API Quick Start

ASR Version 1.0 is a product that allows NetRefer clients to use REST Principles to generate reports from data processed via PMP.

In the case of ASR or Affiliate Standard Reporting, we extend an API endpoint that allows clients to view the status/performance reports of an affiliate for:

  1. Daily Activity Report - for the date range provided.

  2. Period Invoice Report - for the year and month provided.

The Authentication flow is as depicted below:

Using Active Directory to request a JWT

OAuth 2.0 is used to get access to the ASR API.

To authenticate within NetRefer and to call the ASR API, developers have to request JWT, providing the following parameters:

  • Grant type: password

  • Client Id: will be provided to the client while onboarding to ASR. Example of id is: 56a563d7-9aad-4773-b966-01ec2d1ec5ac

  • Access Token URL: https://login.microsoftonline.com/0e0b50ac-5253-4347-b528-251b2f17cfc6/oauth2/v2.0/token

  • Client Secret: will be provided to the client while onboarding to ASR

  • Username: will be provided to the client while onboarding to ASR

  • Password: will be provided to the client while onboarding to ASR

  • Scope: api://56a563d7-9aad-4773-b966-01ec2d1ec5ac/Reports.Read

 

Once all the requirements are met, execute an HTTP POST call to "Access Token URL" to get the JWT.

In the API request, you have to add an "Authorization" header with the value:

  • Bearer JWT-value-from-NetRefer-DPM

Once all the requirements are met, execute an HTTP POST call to "Access Token URL" to get the JWT.

ASR Version 1.0 Request and Request Parameters

The ASR Version 1.0 Request URLs are formed with the following format:

Daily Activity Report

https://{host}/dpm/v{version_number}/{report_type_code}/{affilaite_id}/{fromdate}/{todate}

The from and to dates need to be within the same month and year. E.g. 2022-05-01 - 2022-05-31

Period Invoice Report

https://{host}/dpm/v{version_number}/{report_type_code}/{affilaite_id}/{year}/{month}

The year parameter format should be 2022.

The month format should be the month number e.g. 6.

Report Types

The Report type codes are as follows:

ASR Version 1.0 API Usage

All ASR Version 1.0 APIs are exposed as REST endpoints.

Request and Response Models

Request data models are presented and described via the OpenAPI specification. (Pending implementation of OpenApi/swagger)

ASR Version 1.0 Responses Model

The Response model is organized around a hierarchy of:

  • Base Reporting Information,

  • Subject Identifiers (Source),

  • Brands

    • Marketing Sources

The Data is grouped by Marketing source per brand.

Base Report Information

The individual data points are organized as:
{ Result: <int>, Adjustment, <int>}

The Result represents the current value accrued by the affiliate during the reporting period,
The purpose of the Adjustment is TBD.

Response Status Codes

Web API uses the following response status codes, as defined in the RFC 2616 and RFC 6585: