NAV
cURL Ruby

Introduction

Welcome to the USIG NSPIRE API! You can use these API to perform the inspection of properties.

The API provides detailed documentation that outlines the changes and requirements introduced by the NSPIRE protocol. It offers clear explanations of the inspection standards, scoring models, and key deficiencies to be addressed.

If you have any question or feedback please contact us at nspire@usinspectiongroup.com

If you want to get more info, please contact us at info@usinspectiongroup.com

Servers

Integration & Authorization

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here" \
  -H "Authorization: {api_token}"

Make sure to replace {api_token} with your own api_token.

NSPIRE uses login API {username} and {password} to allow access to the API. You can SignUp at our NSPIRE Server.

NSPIRE expects for the API Token to be included in all API requests to the server in a header that looks like the following:

Authorization: {api_token}

Login API

HTTP Request

POST https://{server_url}/auth/sign_in
Content-Type: application/json

{
  "user_name": "your_user_name",
  "password": "your_password",
}
  require 'net/http'
  require 'uri'

  uri = URI.parse('https://{server_url}/auth/sign_in')
  http = Net::HTTP.new(uri.host, uri.port)

  request = Net::HTTP::Post.new(uri.path)
  request.set_form_data({
    'username' => 'your_username',
    'password' => 'your_password',
  })

  response = http.request(request)

The above command returns JSON structured like this:

{
  "id": 1,
  "email": "usig.admin@placeholder.com",
  "uid": "usig.admin@placeholder.com",
  "provider": "email",
  "username": "admin",
  "first_name": "Usig",
  "last_name": "Admin",
  "user_type": "admin",
  "properties": {
    "property_ids": ""
  },
  "api_token": "cf3497f1-b7cb-4bc5-b32b-1ad2dederer345c",
  "status": "active"
}

Endpoint to request an OAuth token.

Parameters

Name Type Description
username string Your Username. Required.
password string Your Password. Required.

Properties

Get All Properties

  require 'net/http'
  require 'uri'

  url = URI.parse('https://{server_url}/properties/all')
  req = Net::HTTP::Get.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X GET https://{server_url}/properties/all \
    -H "Authorization: {api_token}"

The above command returns JSON structured like this:

[
  {
    "id": 123,
    "property_code": null,
    "pih_project": "OH",
    "property_name": "Alpha hill Apts",
    "total_building": 5,
    "inspectable_units": null,
    "inspection_date": "2021-04-07",
    "address": "115 Alpha Dr",
    "city": "Miami",
    "state": "KY",
    "zipcode": "42271",
    "properties": {
      "comment": "",
      "is_archived": 0,
      "client_email": "alpha@gmail.com",
      "defect_status": "Uploaded",
      "inspection_date": "2021-04-07 12:16:44",
      "inspection_end_date": "2021-04-07",
      "inspection_finished": "1",
      "inspection_start_date": "2021-04-07"
    },
    "created_by_id": 2,
    "updated_by_id": 2,
    "status": "active",
    "deleted_at": null,
    "created_at": "2021-04-04T21:36:43.000Z",
    "updated_at": "2023-03-31T11:01:25.677Z",
    "property_id": 123,
    "client_email": "alpha@gmail.com",
    "last_modifier_id": 2,
    "inspection_start_date": "2021-04-07",
    "inspection_end_date": "2021-04-07",
    "inspection_finished": "1",
    "comment": "",
    "is_archived": 0,
    "property_image_url": null,
    "phone": null
  }
]

This endpoint retrieves all journeys.

HTTP Request

GET https://{server_url}/properties/all

Request Headers

parameter value Description
Authorization {api_token} Your api_token

Get a Property Details

require 'net/http'
require 'uri'
require 'json'

property_id = 2 # Replace with the actual property ID
url = URI.parse("https://{server_url}/properties/details")
req = Net::HTTP::Post.new(url.path)
req['Authorization'] = '{api_token}'
req.body = { property_id: property_id }.to_json
req.content_type = 'application/json'

res = Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|
  http.request(req)
end

curl -X POST "https://{server_url}/properties/details" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "property_id": 2
  }'

The above command returns JSON structured like this:

{
  "id": 3047,
  "property_code": "0",
  "pih_project": "000012",
  "property_name": "TEST Property B",
  "total_building": 8,
  "inspectable_units": 0,
  "inspection_date": "2023-05-31",
  "address": "123 Main Street",
  "city": "Cityville",
  "state": "ST",
  "zipcode": "12345",
  "properties": {
    "comment": "",
    "is_archived": 0,
    "client_email": "client@example.com",
    "defect_status": "Uploaded",
    "inspection_end_date": "2023-05-31",
    "inspection_finished": 1,
    "inspection_start_date": "2023-05-31"
  },
  "created_by_id": 1157,
  "updated_by_id": 26,
  "status": "active",
  "deleted_at": null,
  "created_at": "2015-12-30T18:02:57.000Z",
  "updated_at": "2023-07-03T12:14:53.435Z",
  "system_id": 2,
  "property_id": 3047,
  "client_email": "client@example.com",
  "last_modifier_id": 26,
  "inspection_start_date": "2023-05-31",
  "inspection_end_date": "2023-05-31",
  "inspection_finished": 1,
  "comment": "",
  "is_archived": 0,
  "property_image_url": null,
  "phone": null,
  "buildings": [
    {
      "id": 12345,
      "property_id": 3047,
      "old_id": "-987654321",
      "building_code": null,
      "building_name": "Building 1",
      "inspectable_units": 1,
      "inspection_date": null,
      "construction_date": "1962-01-01",
      "building_type": "200",
      "properties": {
        "city": "Cityville",
        "state": "ST",
        "address": "123 Main Street",
        "comment": "",
        "zipcode": "12345",
        "uninspectable": "None"
      },
      "created_by_id": 1157,
      "updated_by_id": 26,
      "status": "active",
      "deleted_at": null,
      "created_at": "2015-12-30T18:02:57.000Z",
      "updated_at": "2023-07-03T12:14:31.792Z",
      "app_id": null,
      "building_id": 12345,
      "address": "123 Main Street",
      "city": "Cityville",
      "state": "ST",
      "zipcode": "12345",
      "comment": "",
      "units": [
        {
          "unit_id": 54321,
          "reason_uninspected": null,
          "comment": "",
          "unit_inspected": null,
          "id": 54321,
          "old_id": "-987654321",
          "property_id": 3047,
          "building_id": "12345",
          "unit_code": null,
          "unit_type": "400",
          "unit_name": "Unit 1",
          "occupied": true,
          "properties": {
            "comment": "",
            "uninspectable": "None"
          },
          "created_by_id": 1157,
          "updated_by_id": 26,
          "status": "active",
          "deleted_at": null,
          "created_at": "2015-12-30T18:02:57.000Z",
          "updated_at": "2023-07-03T12:14:31.906Z",
          "app_id": null
        }
      ]
    }
  ]
}

This endpoint retrieves a specific property details.

HTTP Request

POST https://{server_url}/properties/details

Parameters

Parameter Description
property_id The ID of property to retrieve, if not pass, then API will return all the properties data

Create or Update Property

require 'net/http'
require 'json'

uri = URI('https://{server_url}/properties/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri.path)
request['Authorization'] = 'Bearer your_token'
request['Content-Type'] = 'application/json'

request.body = data.to_json

response = http.request(request)
curl -X POST "https://{server_url}/properties/" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d
  '[{
    "property_id":900,
    "property_local_id":102,
    "last_modifier_id":1,
    "property_code":"Test",
    "property_name":"Property API Test Name 7411",
    "total_buildings":2,
    "total_units":8,
    "inspection_start_date":"2019-11-15",
    "inspection_end_date":"2019-11-15",
    "pih_project":"PIH Project",
    "address":"Property Address",
    "city":"City",
    "state":"State",
    "zipcode":"545325",
    "buildings":
    [{
      "building_id":0,
      "building_local_id":100000,
      "last_modifier_id":1,
      "building_code":null,
      "building_name":"Building Name Test 74",
      "inspectable_units":10,
      "inspection_date":"2019-11-15",
      "construction_date":"2019-11-15",
      "building_type":300,
      "uninspectable_reason":"None",
      "address":"Building Address",
      "city":"City",
      "state":"State",
      "zipcode":"zipcode",
      "units":
      [{
        "unit_id":0,
        "unit_local_id":200,
        "last_modifier_id":1,
        "unit_code":null,
        "unit_type":200,
        "unit_name":"Unit Name API 10",
        "occupied":1,
        "uninspectable_reason":"None"
        },
        {
          "unit_id":0,
          "unit_local_id":202,
          "last_modifier_id":1,
          "unit_code":null,
          "unit_type":200,
          "unit_name":"Unit Name API 73",
          "occupied":0
        }
      ]}
    ]
  }]'
  true

HTTP Request

POST https://{server_url}/properties/

Parameters

Parameters Description
property_id The ID of property to update, if zero, then API will create a new property
buildings[] Buildings objects array.
{...,rest} Other data i.e., property_name, pih_project, address, city e.tc
building_id The ID of building to update, if zero, then API will create a new building
buildings[...,units[]] Array of units object in that building
buildings{...,rest} Other data i.e., building_name, building_code, unispectable_reason, city, address e.t.c
unit_id The ID of unit to update, if zero, then API will create a new unit
{...,rest} Other data i.e., unit_code, unit_type, unit_name e.t.c

Property Inspection

Create Property Inspection

  require 'net/http'
  require 'json'

  uri = URI('https://{server_url}/inspection_details/')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['Authorization'] = 'Bearer your_token'
  request['Content-Type'] = 'application/json'

  request.body = data.to_json

  response = http.request(request)
curl -X POST "https://{server_url}/inspection_details/" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d 
  '[{
    "id":0,
    "local_inspection_details_id":200,
    "last_modifier_id":"1",
    "property_id":"1",
    "building_id":"1",
    "inspectable_item_id":null,
    "deficiency_id":null,
    "unit_id":null,
    "inspection_points":null,
    "comments":null,
    "location":null,
    "status":"OD",
    "level":"",
    "image_name":"13686454702181.jpg"
    },
    {
      "id":0,
      "local_inspection_details_id":201,
      "last_modifier_id":"1",
      "property_id":"1",
      "building_id":1,
      "inspectable_item_id":null,
      "deficiency_id":null,
      "unit_id":null,
      "inspection_points":null,
      "comments":null,
      "location":null,
      "status":"N\/A",
      "level":""
    }
  ]'

The above command renders JSON structured like this:

  render json: "Data received. Inspections will be uploaded shortly"

HTTP Request

POST https://{server_url}/inspection_details/

Parameters

Parameters Description
id The ID of inspection_details to be added
property_id Id of property associated with inspection.
building_id The ID of building associated with inspection detials.
{...,rest} Other data i.e., location, unit_id, status, comments e.t.c

Property Inspection Details

  require 'net/http'
  require 'json'

  uri = URI('https://{server_url}/inspection_details/details')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['Authorization'] = 'Bearer your_token'
  request['Content-Type'] = 'application/json'

  request.body = data.to_json

  response = http.request(request)
curl -X POST "https://{server_url}/inspection_details/details" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "property_id": 2
  }'

The above command returns JSON structured like this:

[
    {
        "id": 420193,
        "property_id": 3047,
        "building_id": "73062",
        "unit_id": "98331",
        "inspectable_item_id": 1188,
        "deficiency_definition_id": null,
        "inspection_points": null,
        "comments": null,
        "location": null,
        "properties": {
            "level": null,
            "status": "OD",
            "image_name": null,
            "defect_date": "",
            "local_inspection_details_id": -1
        },
        "created_by_id": 26,
        "updated_by_id": null,
        "status": null,
        "deleted_at": null,
        "created_at": "2023-05-19T16:20:41.308Z",
        "updated_at": "2023-05-19T16:20:41.308Z",
        "property_name": "TEST Property B",
        "item_status": "OD",
        "level": "N/A",
        "is_item_ins": 2
    }
]

This endpoint retrieves a specific property details.

HTTP Request

POST https://{server_url}/inspection_details/details

Parameters

Parameter Description
property_id The ID of inspection property to retrieve details related to it

Send Lt Report

  require 'net/http'
  require 'json'

  uri = URI('https://{server_url}/send_lt_report_email?property_id=7073&user_id=1&client_email=arakhtar@foomotion.io')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Get.new(uri.path)
  request['Authorization'] = 'Bearer your_token'
  request['Content-Type'] = 'application/json'

  request.body = data.to_json

  response = http.request(request)
curl -X GET "https://{server_url}/send_lt_report_email?property_id=7073&user_id=1&client_email=arakhtar@foomotion.io" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "property_id":7073,
    "user_id":1,
    "client_id":"youremail@example.com"
  }'
    true

HTTP Request

GET https://{server_url}/send_lt_report_email?property_id=7073&user_id=1&client_email=arakhtar@foomotion.io

Parameters

Parameters Description
property_id Id of property related to your report.
user_id User's ID
client_email Email ID of client

Uninspectable Buildings and Units

Get Uninspected Buildings and Units

  require 'net/http'
  require 'json'

  uri = URI('https://{{aws_instance}}/property_data/reasons_uninspectable ')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['Authorization'] = 'Bearer your_token'
  request['Content-Type'] = 'application/json'

  request.body = data.to_json

  response = http.request(request)
curl -X POST "https://{server_url}/{{aws_instance}}/property_data/reasons_uninspectable" \
  -H "Authorization: {api_token}" \
  -H "Content-Type: application/json" \
  -d ' '

The above command returns JSON structured like this:

    {
    "reasons_building": [
        {
            "id": 7,
            "property_id": 0,
            "key": "reason_uninspectable.building",
            "value": [
                "No Keys Available",
                "Offline",
                "Fire Damage",
                "Screen\/Storm Door Locked",
                "Occupant Refusal",
                "Occupant Refusal: COVID-19 Concerns",
                "Dog Hazard",
                "Other Hazard",
                "Demolished",
                "Police Restricted Area",
                "None"
            ],
            "properties": null,
            "created_by_id": 6,
            "updated_by_id": 6,
            "status": "active",
            "deleted_at": null,
            "created_at": "2013-08-20T01:00:48.000Z",
            "updated_at": "2021-11-12T11:13:40.000Z"
        }
    ],
    "reasons_unit": [
        {
            "id": 8,
            "property_id": 0,
            "key": "reason_uninspectable.unit",
            "value": [
                "No Keys Available",
                "Offline",
                "Fire Damage",
                "Screen\/Storm Door Locked",
                "Occupant Refusal",
                "Occupant Refusal: COVID-19 Concerns",
                "Dog Hazard",
                "Other Hazard",
                "Demolished",
                "Legal Proceeding (eviction)",
                "Vacant - Client Doesn't Want Inspected",
                "Client Doesn't Want Inspected",
                "Police Restricted Area",
                "Resident Not Home (Virtual Inspection)",
                "None"
            ],
            "properties": null,
            "created_by_id": 6,
            "updated_by_id": 6,
            "status": "active",
            "deleted_at": null,
            "created_at": "2013-08-20T01:00:48.000Z",
            "updated_at": "2021-11-12T11:13:40.000Z"
        }
    ]
}

HTTP Request

POST https://{server_url}/{{aws_instance}}/property_data/reasons_uninspectable

Parameters

Parameters Description
default: (:key) Search for properties with :key ='reason_uninspectable.building'
default: (:key) Search for properties with :key ='reason_uninspectable.unit'

Fixed Assets

Get Assets Types

  require 'net/http'
  require 'uri'

  url = URI.parse('https://{{global_url}}/property_data/assets_type')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{global_url}}/property_data/assets_type \
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1
    }'

The above command returns JSON structured like this:

[
    {
        "id": 12113,
        "property_id": 0,
        "key": "fixed_assets.types",
        "value": [
            "Stove",
            "Refrigerator",
            "Water Heater",
            "Inside HVAC",
            "Outside HVAC",
            "Range Hood",
            "Microwave",
            "Dishwasher",
            "Washing Machine",
            "Dryer",
            "Garbage Disposal"
        ],
        "properties": null,
        "created_by_id": 6,
        "updated_by_id": 6,
        "status": "active",
        "deleted_at": null,
        "created_at": "2014-06-15T15:14:41.000Z",
        "updated_at": "2021-11-12T11:13:40.000Z"
    }
]

HTTP Request

POST https://{{global_url}}/property_data/assets_type

Parameters

parameter Description
user_id ID of user

Get Assets Condition

  require 'net/http'
  require 'uri'

  url = URI.parse('https://{{global_url}}/property_data/assets_conditions)')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{global_url}}/property_data/assets_conditions \
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1
    }'

The above command returns JSON structured like this:

[
    {
        "id": 33062,
        "property_id": 0,
        "key": "fixed_assets.conditions",
        "value": [
            "Good",
            "Fair",
            "Poor",
            "New",
            "NA"
        ],
        "properties": null,
        "created_by_id": 6,
        "updated_by_id": 6,
        "status": "active",
        "deleted_at": null,
        "created_at": "2015-03-13T19:02:08.000Z",
        "updated_at": "2021-11-12T11:13:40.000Z"
    }
]

HTTP Request

POST https://{{global_url}}/property_data/assets_conditions

Parameters

parameter Description
user_id ID of user

Make Assets

  require 'net/http'
  require 'uri'

  url = URI.parse('https://{{global_url}}/property_data/assets_make)')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{global_url}}/property_data/assets_make\
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1
    }'

The above command returns JSON structured like this:

[
    {
        "id": 32388,
        "property_id": 0,
        "key": "fixed_assets.makes",
        "value": [
            "Amana",
            "Brown",
            "Electrolux",
            "Frigidaire",
            "GE",
            "Haier",
            "Hotpoint",
            "Kenmore",
            "Maytag",
            "Magic Chef",
            "Roper",
            "Sears",
            "Summitt",
            "Whirlpool",
            "Rheem",
            "Rudd",
            "NA"
        ],
        "properties": null,
        "created_by_id": 6,
        "updated_by_id": 6,
        "status": "active",
        "deleted_at": null,
        "created_at": "2015-03-11T17:37:36.000Z",
        "updated_at": "2021-11-12T11:13:40.000Z"
    }
]

HTTP Request

POST https://{{global_url}}/property_data/assets_make

Parameters

parameter Description
user_id ID of user

Meta Data

Get Meta Data of Inspection Area

  require 'net/http'
  require 'uri'

  url = URI.parse('https://{{url}}/inspection_area/meta_data)')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{url}}/inspection_area/meta_data\
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1
    }'

The above command returns JSON structured like this:

[
    {
        "area_id": 1,
        "area_code": "ST",
        "area_name": "Site",
        "inspectable_item_id": 1,
        "item_code": "ST10000001",
        "title": "Fencing and Gates",
        "description": "Fence: A structure functioning as a boundry or barrier.  An upright structure serving to enclose, divide or protect an area.  Gate: A structured opening in a fence for entrance or exit.",
        "deficiency": [
            {
                "deficiency_id": 81,
                "deficiency_title": "Security Fence",
                "deficiency_code": "STFN100001",
                "type": "NHS",
                "updated_ts": "2015-05-01T11:56:54.000Z",
                "_type": "inspectable_deficiency",
                "comment": "Fence is damaged, Fence is leaning / falling, Sections of fence is damaged/falling, Fence is rusted, Fence has hole cut for passage, ",
                "L1": "1",
                "L2": "1",
                "L3": "1",
                "LT": "0",
                "lt_type": "",
                "inspectable_item_id": 1,
                "detail": "",
                "description": "",
                "note": "Typically, most of the fencing on the property is considered \\",
                "location": "Front of property, Rear of property, Front of building #, Near building #, Near unit #",
                "l1_description": "Security fence has small areas of damage (smaller than 12inches x 12inches) in LESS than 25% of a single fence. ",
                "l3_description": "Security fence has a large area of damage (larger than 12inches x 12inches) or has a missing section or gate",
                "l2_description": "Security fence has small areas of damage (smaller than 12inches x 12inches) in MORE than 25% of a single fence. "
            },
            {
                "deficiency_id": 82,
                "deficiency_title": "Holes",
                "deficiency_code": "STFN200001",
                "type": "NHS",
                "updated_ts": "2013-08-07T21:20:04.000Z",
                "_type": "inspectable_deficiency",
                "comment": "Small hole is noted in fence, Large hole is noted in fence",
                "L1": "1",
                "L2": "0",
                "L3": "1",
                "LT": "0",
                "lt_type": null,
                "inspectable_item_id": 1,
                "detail": "",
                "description": "There is an opening or penetration in any fence or gate designed to keep intruders out or children in.  Look for holes that could allow animals to enter or could threaten the safety of children.",
                "note": "If the fence or gate is not designed to keep intruders out or children in --such as a rail fence -- do not evaluate it for holes.",
                "location": "Front of property, Rear of property, Front of building #, Near building #, Near unit #",
                "l1_description": "The hole is smaller than 6 inches by 6 inches.",
                "l3_description": "The hole is larger than 6 inches by 6 inches.",
                "l2_description": "N/A"
            }
        ]
    }
]

HTTP Request

POST https://{{url}}/inspection_area/meta_data

Parameters

parameter Description
user_id ID of user

Image Upload

Upload Property Image

  require 'net/http'
  require 'uri'

  url = URI.parse('{{global_url}}/properties/image)')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{global_url}}/properties/image\
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1,
      "property_id" : 1,
      "image" : 'march2.png'
    }'

The above command returns JSON structured like this:

  true

HTTP Request

POST https://{{global_url}}/properties/image

Parameters

parameter Description
user_id ID of user
property_id Property associated with user
image Attached image

Upload Property Inspection Images

  require 'net/http'
  require 'uri'

  url = URI.parse('{{global_url}}/inspection_details/image)')
  req = Net::HTTP::Post.new(url.path)
  req['Authorization'] = '{api_token}'

  res = Net::HTTP.start(url.host, url.port) do |http|
    http.request(req)
  end
  curl -X POST https://{{global_url}}/inspection_details/image\
    -H "Authorization: {api_token}" \
    -d '
    {
      "user_id" : 1,
      "image" : 'march2.png'
    }'

The above command returns JSON structured like this:

  true

HTTP Request

POST https://{{global_url}}/inspection_details/image

Parameters

parameter Description
user_id ID of user
image Attached image

Schemas

Create or Update Property Details

Data Array passsed in JSON structure looks like this:

  [
    {
      "property_id":900,
      "property_local_id":102,
      "last_modifier_id":1,
      "property_code":"Test",
      "property_name":"Property API Test Name 7411",
      "total_buildings":2,
      "total_units":8,
      "inspection_start_date":"2019-11-15",
      "inspection_end_date":"2019-11-15",
      "pih_project":"PIH Project",
      "address":"Property Address",
      "city":"City",
      "state":"State",
      "zipcode":"545325",
      "buildings":
      [
        {
          "building_id":0,
          "building_local_id":100000,
          "last_modifier_id":1,
          "building_code":null,
          "building_name":"Building Name Test 74",
          "inspectable_units":10,
          "inspection_date":"2019-11-15",
          "construction_date":"2019-11-15",
          "building_type":300,
          "uninspectable_reason":"None",
          "address":"Building Address",
          "city":"City",
          "state":"State",
          "zipcode":"zipcode",
          "units":
          [
            {
              "unit_id":0,
              "unit_local_id":200,
              "last_modifier_id":1,
              "unit_code":null,
              "unit_type":200,
              "unit_name":"Unit Name API 10",
              "occupied":1,
              "uninspectable_reason":"None"
              }
          ]
        }
      ]
    }
  ]
Parameter Type Description
property _id number The ID of the property if not given then api will create a new property otherwise it will update the exsisting property.
building_local_id number The ID of the building.
last_modifier_id number Last Modified ID of the property
property_code string Code of property.
property_name string Name of property.
total_buildings number Total number of buildings in that property.
total_units number Total number of units in that buildings.
inspection_start_date date Starting date of inspection.
inspection_end_date date Ending date of inspection.
pih_project string Project related to that property.
address string Address of property.
city string Name of city
state string Name of state
zipcode string Zipcode
buildings[] array Array of buildings objects.
:buildings_id string ID of building.
:last_modifier_id number Last Modified ID of the building.
:building_code string Code of building.
:building_name string Name of building.
:inspectable_units number Total number of inspectable units in that building.
:inspection_date date Date to inspection.
:construction_date date Date of construction.
:building_type string Type of building.
:uninspectable_reason string Reason of uninspection if any otherwise null.
:address string Address of bulding.
:city string Name of city.
:state string Name of state
:zipcode string Zipcode
:untis[] array Array of units objects in that building.
:unit_id string ID of unit.
:unit_local_id string Local Id of unit.
:last_modifier_id number Last Modified ID of the unit.
:unit_code string Code of unit.
:unit_type string Type of unit.
:unit_name string Name of unit.
:occupied bool Occuoied or Not.
:uninspectable_reason string Reason of uninspection if any otherwise null.

Create Property Inspection Details

Data Array passsed in JSON structure looks like this:

  [
    {
      "id":0,
      "local_inspection_details_id":200,
      "last_modifier_id":"1",
      "property_id":"1",
      "building_id":"1",
      "inspectable_item_id":null,
      "deficiency_id":null,
      "unit_id":null,
      "inspection_points":null,
      "comments":null,
      "location":null,
      "status":"OD",
      "level":"",
      "image_name":"13686454702181.jpg"
    },
    {
      "id":1,
      "local_inspection_details_id":201,
      "last_modifier_id":"1",
      "property_id":"1",
      "building_id":1,
      "inspectable_item_id":null,
      "deficiency_id":null,
      "unit_id":null,
      "inspection_points":null,
      "comments":null,
      "location":null,
      "status":"N\/A",
      "level":""
    },
  ]
Parameter Type Description
id number The ID of the inspection, Id is zero if status is 'OD' otherwise Id is non-zero.
local_inspection_details_id number Inspection detail local id of that inspection.
last_modifier_id number Last modified id of inspection.
property_id string Id of property associated with inspection details.
building_id string Id of building associated with inspection details.
inspectable_item_id number Id of inspectable item associated with inspection details if any otherwise null.
deficiency_id number Id of deficiency if any otherwise null.
unit_id string Id of unit associated with inspection details.
inspection_points string Inspection points if any otherwise null.
comments string Comments if any otherwise null.
location string Location if any otherwise null.
status string Status of inspection, OD or N\/A.
level string level of inspection.
image_name string Name of image if any otherwise empty.

Errors

The Kittn API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The kitten requested is hidden for administrators only.
404 Not Found -- The specified kitten could not be found.
405 Method Not Allowed -- You tried to access a kitten with an invalid method.
406 Not Acceptable -- You requested a format that isn't json.
410 Gone -- The kitten requested has been removed from our servers.
418 I'm a teapot.
429 Too Many Requests -- You're requesting too many kittens! Slow down!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.