Fields

Each vertical has a specific set of fields that are required to post a lead to Oasis Leads.

EXAMPLE

def get_required_fields():
  url = 'https://api.oasisleads.com/get_required_fields'
  payload = {'vendor_id': 'your_id','api_key': 'youe key', 'vertical_id': "5"}
  r = requests.post(url, data=payload)
  return r.text

Will return:

{"required_fields": [{"field_id": 67, "field": "test_field_1"}, {"field_id": 68, "field": "test_field_2"}, {"field_id": 69, "field": "test_field_3"}]}

When sending a lead to Oasis Leads you must attach all required fields to the JSON lead object in the "fields" section

Formatting:

"fields": [{"field_id": 67, "answer_id": 0},{"field_id": 68, "answer_id": 1},{"field_id": 69, "answer_id": [1,2]}]

in the case of multiple answer questions the answer id should be sent as an array

{"field_id": 69, "answer_id": [1,2]}]

if the user only selects 1 answer to a multiple selection question it should be sent as an interger

{"field_id": 69, "answer_id": 1}]

If no_key is set to 1 it means that field does not require a answer_id but a answer instead. Answers are open ended compared to answer_id which is a keyed answer. The formating for fields with no_key set to 1 is as follows:

{"field_id": 70, "answer": "an open ended example answer"}]

no keyed answers should have a field_id and answer as apart of the field object.