Modular Survey | PS <> Buyer rules and API instructions

Rules and Instructions:

Schema:

image-20240619-165529.png

Buyer Note:

  • The operator should activate a configuration flag under Configuration Settings - Modular Survey

    • EXAMPLE to ADD

  • Buyer should activate the supplier ID, survey ID, and transaction ID on the Buyer settings page.

    • Buyer Settings:

      Screenshot 2024-06-19 at 18.02.22.png

Suppliers to enable:

Suppliers that agreed to work with Modular Survey:

  • Prime

  • CPX

Note: David Breihan is working to onboard more supplier. The list is might not up to date.

API ENDPOINT SPECIFICATION:

All our APIs are protected and they can be used only through an API token linked to your account. Please read this document before using the following endpoints.

https://purespectrum.atlassian.net/wiki/spaces/PBA/pages/341803016

(API) Endpoints 1: Validate the Transaction and create a new Transaction

Use this API to validate the Respondent and in case of a valid transaction.

Buyer must send the survey_id, supplier_id, and transaction_id (core transaction) in the API.

($apihost is the environment against which you are testing, and $basepath is the base path with the api version. All Buy API calls will require access-token parameter in the header) 

POST $apihost/$basepath/buyers/v2/surveys/SURVEY_ID/transactions?supplier_id=SUPPLIER_ID&transaction_id=TRANSACTION_ID

Body (Optional if data is sent via URL):

{ "supplier_id": 2, "transaction_id": "40AekOxWhKu8hffwcm7LC7" }

Response (Transaction is valid for next study):

{ "transaction_id": "01vA34sCj8wffKBmelT6xT" }

Response (Transaction is NOT valid for next study):

Response (Supplier did NOT agree to Modular Survey):

 

(API) Endpoints 2: Register the Transaction as Complete

Use this API to complete a transaction (modular transaction).

Body:

Response 200 OK:

 

NOTE:

  1. In case the survey uses the CPI override or fixed, the CPI associated with the new transaction is the same as the original transaction.

  2. In case the survey uses the dynamic price or dynamic CPI, the CPI associated with the new transaction is the one calculated within the last block.

  3. Buyer should always use the original transaction (core TX) to request a new transaction for a respondent eligible for modular study.

  4. Buyers should always use the API endpoint 2 to register the TX as Complete or any other status.

  5. Buyer should always redirect the respondent using the /surveyDone page and the initial transaction (core transaction)

Not developed:

  1. Assign a different CPI to any new transaction. Buyer might have a different CPI if the respondent complete a modular or long form study.

  2. Supplier is not advised if the respondent completed a modular study. They should provide an Endpoint that allow PureSpectrum to send the details.