Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

API Documentation

Eric Berry edited this page Sep 28, 2018 · 13 revisions

API Documentation

POST /api/v1/impression/:property_id

Impressions can now be generated via an API request to the CodeFund system. You must have an admin give you API access and have an API Key generated in the view where you edit your profile (https://codefund.io/registrations/edit).

Request

  • Method: POST
  • Path: /api/v1/impression/:property_id
  • Request Headers: X-CodeFund-API-Key: tMdzNtvFN7sDmhr
  • Required Fields: ip_address
  • Optional Fields: height (browser viewport height) width (browser viewport width) user_agent (browser user agent)

Response

  • Status: 200

Example Response Body:

{
  "description": "Full-stack error tracking & analytics for JS developers. Try it Free! 🐛",
  "headline": "Airbrake.io",
  "large_image_url": "https://d2nhukomolqgak.cloudfront.net/216d1c7f-3dfa-47c6-8fa5-5cf605443607_airbrake-260x200.png",
  "reason": null,
  "images": [
    {
      "height": 200,
      "size_descriptor": "small",
      "url": "https://d2dgtjbaa79whh.cloudfront.net/image.jpg",
      "width": 200
    }, 
    {
      "height": 200,
      "size_descriptor": "large",
      "url": "https://d2dgtjbaa79whh.cloudfront.net/image.jpg",
      "width": 280
    }
  ],
  "link": "https://codefund.io/c/fad4f746-a8cd-4ff5-b2bf-9acbf43e937f",
  "pixel": "//codefund.io/p/fad4f746-a8cd-4ff5-b2bf-9acbf43e937f/pixel.png",
  "poweredByLink": "https://codefund.io?utm_content=a9870049-f3f2-4161-b52b-c46cf887c7f5",
  "small_image_url": "https://d2nhukomolqgak.cloudfront.net/07a048a5-4d9a-4815-9b42-6f6a25b9db22_airbrake-200x200.png",
  "house_ad": false
}

If you prefer to not return a house ad when accessing the API, let us know. This can be configured on the property settings.

If there are no ads to be shown, the following response will be returned:

{
    "small_image_url": "",
    "reason": "CodeFund does not have an advertiser for you at this time",
    "poweredByLink": "https://codefund.io?utm_content=",
    "pixel": "",
    "link": "",
    "large_image_url": "",
    "images": [],
    "house_ad": false,
    "headline": "",
    "description": ""
}
Clone this wiki locally