Prototypr Docs Logo Docs

Measure API Endpoints Documentation

The endpoints in this doc have been created to help support organizations with their digital analytics efforts.

Prototypr.ai understands how important it is to have access to high quality data when measuring user experiences and marketing campaigns. The intent behind these APIs is to make it easier for your organization to update data that lives within prototypr.ai in a safe, private and secure way.

Measure Endpoints

As a prototypr.ai customer, you have access to the following APIs:

  • Update Forecast

    Programmatically update forecast cards in Test Center with your own data models.

More customer facing measurement APIs will be available soon! If you have any feedback or feature requests about these APIs, please take the time to fill out our developer survey.

Update Forecast POST

Purpose

Enable developers to update a forecast card in the AI Analytics platform with your own data, instead of using the default Prophet forecast.

Type of Request: POST

URL: https://www.prototypr.ai/api/v1/update-forecast

Headers

  • Authentication: Bearer ${TOKEN}
  • Content-Type: application/json
  • Accept: application/json

Request Body

  • user_id: String

    This is your prototypr.ai user_id

  • workspace_id: String

    This is your prototypr.ai workspace_id

  • card_id: String

    This is the forecast card you want to update in /test-center

  • dates: List of Strings

    Must be formatted as "yyyy-mm-dd". The first date must be the start of the current quarter.

  • values: Float or Int

    A list of forecasted values. Length must equal the number of days in the specified date range.

Python Request

import requests
import os
import json

url = "https://www.prototypr.ai/api/v1/update-forecast"
payload = {
    "user_id": "your_user_id",
    "workspace_id": "your_workspace_id",
    "card_id": "your_forecast_card_id",
    "forecastData": {
        "dates": list_of_forecast_dates,
        "values": list_of_forecast_values
    }
}
headers = {
    "Authorization": "Bearer " + os.getenv("API_KEY"),
    "Content-Type": "application/json",
    "Accept": "application/json"
}

response = requests.post(url, data=json.dumps(payload), headers=headers)
print(response.json())

Sample Response

{ "data": {
    "log":
      {
        "request_count": "1",
        "request_date": "2024-05-07 11:41:18",
        "request_id": "71a6c2e84b694cfff2b92fdfa23",
        "service": "update forecast",
      },
    "message": "forecast saved"
    }
}

Rate Limits and API Usage Stats

Currently there are rate limits of 25 requests/day across all API endpoints. This limit will scale as prototypr.ai adds more services.

If you need more, please feel free to connect with Gareth Cull, the creator of prototypr.ai.

As part of this API Service, prototypr.ai provides detailed usage stats so that you can monitor API key performance and volume.