Buyer API Fail Detection

Description: This API checks for the Open-Ended (OE) survey responses to ensure data quality. It performs language comparison, AI-generated answer detection, exclusion list checks, and response deduplication. Implement the API endpoint after every open-ended question into your survey.

  • Language Mismatch: Compares the language of the OE answer with the survey language determined from the transaction ID.

  • AI Detection: Detects patterns to flag if the answer is AI-generated content.

  • Excluded text: Flags any unacceptable responses such as jibberish, curse words, etc.

  • PureText Deduplication: Ensures the answer's uniqueness through deduplication.

PureText should only be used:

  • For expected responses with at least one meaningful sentence (not categorical responses such as brand names, people and place names, slang, etc)

  • Expected responses are in the same language as survey language (For example, if the survey is in French, response should be only in French)

Request

POST $apihost/$basepath/transactions/ps_api_fail

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

Parameters:

Body:

{ "question_id": "alpha numberic", "text": "string", "transacion_id": "2W6ZHlCrBZIgyf9kH04Stb" }

Result:

Response Body:

{ "transaction_id": "2W6ZHlCrBZIgyf9kH04Stb", "buyer_ps_api_fail": true, }

If "buyer_ps_api_fail": true terminate the session with status code 84.

URL: https://spectrumsurveys.com/surveydone?st=84&transaction_id=[transaction_id]

Response Codes:

  • 200 OK: The validation process was completed successfully.

  • 400 Bad Request: Invalid input or missing fields in the payload.

Error:

The API can only be used for valid transactions.

{ "ps_buy_api_status_code": 1014, "ps_api_response_message": "Invalid transaction" }

The API requires all parameters to be valid and present.

Example 1 for a termination due to AI detection:

POST https://spectrumsurveys.com/buyers/v2/transactions/ps_api_fail

Body:

Response which results in a termination:

Example 2 for a termination due to PureText Deduplication:

POST https://spectrumsurveys.com/buyers/v2/transactions/ps_api_fail

Body:

Response which results in a termination:

Â