πŸ“—
UpGrade Platform - Documentation
6.0
6.0
  • UpGrade Overview
  • Creating an Experiment
    • Unit of Assignment
    • Simple Experiment
    • Factorial Experiment
    • Inclusion and Exclusion
    • Schedule and Post-Rule
    • Exporting Experiment Data and Design
  • Creating a Feature Flag
  • How UpGrade Works
  • Researcher Guide
  • Developer Guide
    • ⚑Quick Start: Running UpGrade Locally with Docker
    • ⚑Quick Start: Running locally w/o Docker
    • UpGrade + AdapComp (Mooclet) in Docker
    • πŸšΆβ€β™€οΈWalkthroughs
      • Your Application and UpGrade
      • Example 1: A Quiz Web App
      • Example 2: An Online Math Game
    • πŸ“šReference
      • API
      • Client Libraries
        • TypeScript / JS
          • Class: UpgradeClient
          • Class: Assignment
          • SDK Interfaces
            • Interface: IMetric
            • Interface: IExperimentUser
            • Interface: IExperimentUserAliases
            • Interface: ILog
            • Interface: IMarkExperimentPoint
            • Interface: IMetric
            • Interface: IRequestOptions
            • Interface: IResponse
            • Interface: IUser
            • Interface: IUserGroup
      • Environment Variables
        • Frontend Environment
        • Backend Environment
      • Context Metadata
      • Metrics
      • Setting up Google-Auth
      • API Authorization
      • Data Architecture
    • πŸ‘¨β€πŸ’»Contributing Code
      • Branching Workflow (Git-Flow)
      • Pull Request Expectations
    • πŸ˜…Troubleshooting
      • Relation β€˜experiment_condition’ already exists
      • User not found. Authorization error
      • Token is not present in the request header
      • nodemon exits without explanation
      • Unable to find New Relic module configuration
      • No email received for export data
      • Opening a new tab in UpGrade prompts for re-authorization
      • Error: Cannot find module 'upgrade_types' (or a type from 'upgrade_types' does not exist)
  • Glossary
Powered by GitBook
On this page
  1. Developer Guide
  2. Reference

API

Swagger API details

PreviousReferenceNextClient Libraries

This is a snapshot of swagger.json file at time of this release. You can also view the 'live' swagger API documentation details for your hosted backend environment by adding /swagger to your backend hostUrl link.

πŸ“š
get

Get all metrics tracked

Responses
200
Get all Metrics
get
GET /api/metric HTTP/1.1
Host: 
Accept: */*
200

Get all Metrics

No content

  • POST/init
  • POST/groupmembership
  • PATCH/groupmembership
  • POST/workinggroup
  • PATCH/workinggroup
  • POST/assign
  • POST/mark
  • POST/log
  • GET/metric
  • POST/metric
post

Create/Update Experiment User

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
post
POST /api/init HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 185

{
  "id": "user1",
  "group": {
    "schoolId": [
      "school1"
    ],
    "classId": [
      "class1"
    ],
    "instructorId": [
      "instructor1"
    ]
  },
  "workingGroup": {
    "schoolId": "school1",
    "classId": "class1",
    "instructorId": "instructor1"
  }
}
200

Set Group Membership

{
  "id": "text",
  "group": {
    "class": [
      {}
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
post

Set group membership for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
500
null value in column "id" of relation "experiment_user" violates not-null constraint
post
POST /api/groupmembership HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "id": "user1",
  "group": {
    "schoolId": [
      "school1"
    ],
    "classId": [
      "class1"
    ],
    "instructorId": [
      "instructor1"
    ]
  }
}
{
  "id": "text",
  "group": {
    "class": [
      {}
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
patch

Set group membership for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
500
null value in column "id" of relation "experiment_user" violates not-null constraint
patch
PATCH /api/groupmembership HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 99

{
  "id": "user1",
  "group": {
    "schoolId": [
      "school1"
    ],
    "classId": [
      "class1"
    ],
    "instructorId": [
      "instructor1"
    ]
  }
}
{
  "id": "text",
  "group": {
    "class": [
      {}
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
post

Set working group for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
500
null value in column "id" of relation "experiment_user" violates not-null constraint
post
POST /api/workinggroup HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 100

{
  "id": "user1",
  "workingGroup": {
    "schoolId": "school1",
    "classId": "class1",
    "instructorId": "instructor1"
  }
}
{
  "id": "text",
  "group": {
    "class": [
      {}
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
patch

Set working group for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
500
null value in column "id" of relation "experiment_user" violates not-null constraint
patch
PATCH /api/workinggroup HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 100

{
  "id": "user1",
  "workingGroup": {
    "schoolId": "school1",
    "classId": "class1",
    "instructorId": "instructor1"
  }
}
{
  "id": "text",
  "group": {
    "class": [
      {}
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
post

Assign a Experiment Point

Body
userIdstringOptionalExample: user1
contextstringOptionalExample: add
Responses
200
Experiment Point is Assigned
application/json
404
Experiment user not defined
500
null value in column "id" of relation "experiment_user" violates not-null constraint
post
POST /api/assign HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "userId": "user1",
  "context": "add"
}
[
  {
    "site": "text",
    "target": "text",
    "condition": "text"
  }
]
post

Mark a Experiment Point

Body
userIdstringRequired
sitestringOptional
targetstringOptionalExample: partition1
conditionstringRequiredExample: control
statusstringOptionalExample: condition applied
experimentIdstringOptionalExample: exp1
Responses
200
Experiment Point is Marked
application/json
500
User not defined
post
POST /api/mark HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 126

{
  "userId": "text",
  "site": "text",
  "target": "partition1",
  "condition": "control",
  "status": "condition applied",
  "experimentId": "exp1"
}
{
  "id": "text",
  "experimentId": "text",
  "site": "text",
  "target": "text",
  "condition": "text"
}
post

Post log data

Body
userIdstringOptional
Responses
200
Log data
500
null value in column "id\" of relation \"experiment_user\" violates not-null constraint
post
POST /api/log HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 289

{
  "userId": "text",
  "value": [
    {
      "userId": "user1",
      "metrics": {
        "attributes": {
          "continuousMetricName": 100,
          "categoricalMetricName": "CATEGORY"
        },
        "groupedMetrics": [
          {
            "groupClass": "workspaceType",
            "groupKey": "workspaceName",
            "attributes": {
              "continuousMetricName": 100,
              "categoricalMetricName": "CATEGORY"
            }
          }
        ]
      }
    }
  ]
}

No content

post

Add filter metrics

Body
metricUnitobjectOptional
Responses
200
Filtered Metrics
500
Insert error in database
post
POST /api/metric HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "metricUnit": {}
}

No content