API Use-case: Claimant try to sell the item previously

How to use the Mohawk Automation (API) when the claimant has tried to sell the item previously. 

Claimant try to sell the item previously

Situation: a claim is filed by someone (the claimant), however, the claimant has previously tried to offer the product for sale. Giving a potential indication of swindle.

Solution: Check that the claimant, claimant, has not previously offered the product for which the claim is made online.

Python:

import requests

url = 'https://api.mohawkanalytics.com/classifiedads/gb/v1/license_plate'

claimant_license_plate = 'EN18UWW'

headers = {'API-Key':'<YOUR_API_KEY>'}
data = {'license_plate': claimant_license_plate}

resp = requests.post(url, data=data, headers=headers)

# check the authors who have previously sold the claimts_item
author_list = [item['fields']['author'] for item in resp.json()['documents'] if 'author' in item['fields']]

# extract latest value
print(author_list)

# build internal test for logic
# IF claimant IS IN author_list THEN THROW WARNING

With the following response:

['Pulman SEAT', 'Motorparks Dealers']

 

Here we see that the claimants name shows up in the list of examples and should therefore throw up a flag in the internal system.