πŸ“—
UpGrade Platform - Documentation
6.1
6.1
  • 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
  • Working with Segments
  • How UpGrade Works
  • Developer Guide
    • ⚑Quick Start: Running UpGrade Locally with Docker
    • ⚑Quick Start: Running locally w/o Docker (on MacOS or Linux)
    • 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

Last updated 20 days ago

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.

πŸ“š
  • POST/v5/init
  • PATCH/v5/groupmembership
  • PATCH/v5/workinggroup
  • POST/v5/mark
  • POST/v5/assign
  • POST/v5/log
  • POST/v5/bloblog
  • POST/v5/featureflag
  • PATCH/v5/useraliases
  • POST/v6/init
  • PATCH/v6/groupmembership
  • PATCH/v6/workinggroup
  • POST/v6/mark
  • POST/v6/assign
  • POST/v6/log
  • POST/v6/featureflag
  • PATCH/v6/useraliases
post

Create/Update Experiment User

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/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"
  }
}
{
  "id": "text",
  "group": {
    "class": [
      "text"
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
patch

Set group membership for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v5/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": [
      "text"
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
patch

Set working group for a user

Body
idstringOptionalExample: user1
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v5/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": [
      "text"
    ]
  },
  "workingGroup": {
    "school": "text",
    "class": "text",
    "instructor": "text"
  }
}
post

Mark a Experiment Point

Body
userIdstringRequired
statusstringOptionalExample: condition applied
Responses
200
Experiment Point is Marked
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/mark HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 161

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

Assign a Experiment Point

Body
userIdstringOptionalExample: user1
contextstringOptionalExample: add
Responses
200
Experiment Point is Assigned
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/assign HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "userId": "user1",
  "context": "add"
}
[
  {
    "site": "text",
    "target": "text",
    "experimentType": "Simple",
    "assignedCondition": [
      {
        "conditionCode": "text",
        "payload": {
          "type": "text",
          "value": "text"
        },
        "id": "text",
        "experimentId": "text"
      }
    ]
  }
]
post

Post log data

Body
userIdstringOptional
Responses
200
Log data
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/log HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 331

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

No content

post

Post blob log data

Body
userIdstringOptional
valueobject[]Optional
Responses
200
Log blob data
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/bloblog HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 30

{
  "userId": "text",
  "value": [
    {}
  ]
}

No content

post

Get all feature flags using SDK

Body

User Document

userIdstringOptionalExample: user1
contextstringOptionalExample: add
Responses
200
Feature flags list
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v5/featureflag HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "userId": "user1",
  "context": "add"
}

No content

patch

Set aliases for current user

Body
userIdstringRequiredExample: user1
aliasesstring[]Required
Responses
200
Experiment User aliases added
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v5/useraliases HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 41

{
  "userId": "user1",
  "aliases": [
    "alias123"
  ]
}
{
  "userId": "text",
  "aliases": [
    "text"
  ]
}
post

Create/Update Experiment User

Body
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v6/init HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 172

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

Set group membership for a user

Body
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v6/groupmembership HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 86

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

Set working group for a user

Body
Responses
200
Set Group Membership
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v6/workinggroup HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 87

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

Mark a Experiment Point

Body
statusstringOptionalExample: condition applied
Responses
200
Experiment Point is Marked
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v6/mark HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 145

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

Assign a Experiment Point

Body
contextstringOptionalExample: add
Responses
200
Experiment Point is Assigned
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v6/assign HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "context": "add"
}
[
  {
    "site": "text",
    "target": "text",
    "experimentType": "Simple",
    "assignedCondition": [
      {
        "conditionCode": "text",
        "payload": {
          "type": "text",
          "value": "text"
        },
        "id": "text",
        "experimentId": "text"
      }
    ]
  }
]
post

Post log data

Body
Responses
200
Log data
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v6/log HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 315

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

No content

post

Get all feature flags using SDK

Body

User Document

contextstringOptionalExample: add
Responses
200
Feature flags list
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
post
POST /api/v6/featureflag HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 17

{
  "context": "add"
}

No content

patch

Set aliases for current user

Body
aliasesstring[]Required
Responses
200
Experiment User aliases added
application/json
400
BadRequestError - InvalidParameterValue
401
AuthorizationRequiredError
404
Experiment User not defined
500
Internal Server Error
patch
PATCH /api/v6/useraliases HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "aliases": [
    "alias123"
  ]
}
{
  "userId": "text",
  "aliases": [
    "text"
  ]
}