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:

  1. Update Forecast

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 this short survey.

Update Forecast

Purpose

Enable developers to update a forecast card in Test Center 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 in the list must be the start of the current quarter. The last date must be the last date of the current quarter.

  • values: Float or Int

    A list of forecasted values for the current quarter. The length of the list must equal the number of days between the first and last day of the current quarter

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/day across all API endpoints. This will grow over time as prototypr.ai adds more endpoints. If you need more, please feel free to connect with Gareth Cull, who is the creator of prototypr.ai.

As part of this API Service, prototypr.ai provides usage stats so that you can see how often your api key is being used.

API Feedback

Your feedback is critical for prototypr.ai to improve its products and services. Please consider taking this short 2-3 minute developer feedback survey about the prototypr.ai API.