Skip to content

Instantly share code, notes, and snippets.

@mharris717
Created May 19, 2020 15:43
Show Gist options
  • Save mharris717/8b26fe95aefc4b591759e1cfd9a2b491 to your computer and use it in GitHub Desktop.
Save mharris717/8b26fe95aefc4b591759e1cfd9a2b491 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "API for modeling Orgs, Projects, and Users",
"description": "",
"version": "0.0.1"
},
"servers": [
{
"url": "https://api.liveramp.com/orgs"
}
],
"tags": [
{
"name": "Org",
"description": "(resource) Organisation, Org for short is the top level resource to which all other resources have membership."
},
{
"name": "Org::OwnedProject",
"description": "(subresource) A Project is owned by one Org Returns projects I own"
},
{
"name": "Org::GrantedProject",
"description": "(subresource) "
},
{
"name": "User",
"description": "(resource) Users are members of an Organisation. They can be members of more than one Organisation\nUsers can be an Admin of only one Organisation"
},
{
"name": "Grant",
"description": "(resource) A Grant allows temporary access to an Asset type"
}
],
"paths": {
"/v1/orgs": {
"post": {
"tags": ["Org"],
"operationId": "Create Org",
"description": "",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgInput"
}
}
}
},
"responses": {
"201": {
"description": "Org created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
}
}
}
}
}
}
}
},
"get": {
"tags": ["Org"],
"operationId": "Get Orgs",
"description": "",
"responses": {
"200": {
"description": "Orgs retrieved successfully",
"headers": {
"X-Total-Count": {
"description": "Total number of Orgs returned by the query",
"schema": {
"type": "integer",
"format": "int32"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgMultiResponse"
}
}
}
}
},
"parameters": [
{
"in": "query",
"name": "offset",
"description": "Offset of the Orgs (starting from 0) to include in the response.",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"in": "query",
"name": "limit",
"description": "Number of Orgs to return. If unspecified, 10 max will be returned. Maximum value for limit can be 100",
"schema": {
"type": "integer",
"format": "int32",
"default": 10,
"maximum": 100
}
},
{
"in": "query",
"name": "name",
"description": "",
"required": false,
"schema": {
"type": "string"
}
}
]
}
},
"/v1/orgs/{id}": {
"get": {
"tags": ["Org"],
"operationId": "Get Org",
"description": "",
"responses": {
"200": {
"description": "Org retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgOutput"
}
}
}
},
"404": {
"description": "Org not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "",
"schema": {
"type": "integer",
"format": "int32"
}
}
]
}
},
"/v1/orgs/{orgId}/owned-projects": {
"post": {
"tags": ["Org::OwnedProject"],
"operationId": "Create Org::OwnedProject",
"description": "",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgOwnedProjectInput"
}
}
}
},
"responses": {
"201": {
"description": "OwnedProject created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
}
}
}
}
}
},
"404": {
"description": "Parent resource(s) not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "orgId",
"description": "Id of parent Org",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
]
},
"get": {
"tags": ["Org::OwnedProject"],
"operationId": "Get Org::OwnedProjects",
"description": "",
"responses": {
"200": {
"description": "OwnedProjects retrieved successfully",
"headers": {
"X-Total-Count": {
"description": "Total number of OwnedProjects returned by the query",
"schema": {
"type": "integer",
"format": "int32"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgOwnedProjectMultiResponse"
}
}
}
},
"404": {
"description": "Parent resource(s) not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "orgId",
"description": "Id of parent Org",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"in": "query",
"name": "offset",
"description": "Offset of the OwnedProjects (starting from 0) to include in the response.",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"in": "query",
"name": "limit",
"description": "Number of OwnedProjects to return. If unspecified, 10 max will be returned. Maximum value for limit can be 100",
"schema": {
"type": "integer",
"format": "int32",
"default": 10,
"maximum": 100
}
},
{
"in": "query",
"name": "name",
"description": "",
"required": false,
"schema": {
"type": "string"
}
}
]
}
},
"/v1/orgs/{orgId}/owned-projects/{id}": {
"get": {
"tags": ["Org::OwnedProject"],
"operationId": "Get Org::OwnedProject",
"description": "",
"responses": {
"200": {
"description": "OwnedProject retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgOwnedProjectOutput"
}
}
}
},
"404": {
"description": "OwnedProject or parent resource(s) not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "orgId",
"description": "Id of parent Org",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"in": "path",
"name": "id",
"required": true,
"description": "",
"schema": {
"type": "integer",
"format": "int32"
}
}
]
},
"put": {
"tags": ["Org::OwnedProject"],
"operationId": "Modify Org::OwnedProject",
"description": "",
"responses": {
"200": {
"description": "OwnedProject modified successfully"
},
"404": {
"description": "OwnedProject or parent resource(s) not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "orgId",
"description": "Id of parent Org",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"in": "path",
"name": "id",
"required": true,
"description": "",
"schema": {
"type": "integer",
"format": "int32"
}
}
]
}
},
"/v1/orgs/{orgId}/granted-projects": {
"get": {
"tags": ["Org::GrantedProject"],
"operationId": "Get Org::GrantedProjects",
"description": "",
"responses": {
"200": {
"description": "GrantedProjects retrieved successfully",
"headers": {
"X-Total-Count": {
"description": "Total number of GrantedProjects returned by the query",
"schema": {
"type": "integer",
"format": "int32"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OrgGrantedProjectMultiResponse"
}
}
}
},
"404": {
"description": "Parent resource(s) not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "orgId",
"description": "Id of parent Org",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"in": "query",
"name": "offset",
"description": "Offset of the GrantedProjects (starting from 0) to include in the response.",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"in": "query",
"name": "limit",
"description": "Number of GrantedProjects to return. If unspecified, 10 max will be returned. Maximum value for limit can be 100",
"schema": {
"type": "integer",
"format": "int32",
"default": 10,
"maximum": 100
}
},
{
"in": "query",
"name": "name",
"description": "",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "ownerOrgId",
"description": "",
"required": false,
"schema": {
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
}
}
]
}
},
"/v1/users": {
"post": {
"tags": ["User"],
"operationId": "Create User",
"description": "",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserInput"
}
}
}
},
"responses": {
"201": {
"description": "User created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
}
}
}
}
}
}
}
},
"get": {
"tags": ["User"],
"operationId": "Get Users",
"description": "",
"responses": {
"200": {
"description": "Users retrieved successfully",
"headers": {
"X-Total-Count": {
"description": "Total number of Users returned by the query",
"schema": {
"type": "integer",
"format": "int32"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserMultiResponse"
}
}
}
}
},
"parameters": [
{
"in": "query",
"name": "offset",
"description": "Offset of the Users (starting from 0) to include in the response.",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"in": "query",
"name": "limit",
"description": "Number of Users to return. If unspecified, 10 max will be returned. Maximum value for limit can be 100",
"schema": {
"type": "integer",
"format": "int32",
"default": 10,
"maximum": 100
}
},
{
"in": "query",
"name": "name",
"description": "",
"required": false,
"schema": {
"type": "string"
}
}
]
}
},
"/v1/users/{id}": {
"get": {
"tags": ["User"],
"operationId": "Get User",
"description": "",
"responses": {
"200": {
"description": "User retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserOutput"
}
}
}
},
"404": {
"description": "User not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "",
"schema": {
"type": "integer",
"format": "int32"
}
}
]
}
},
"/v1/grants": {
"post": {
"tags": ["Grant"],
"operationId": "Create Grant",
"description": "",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GrantInput"
}
}
}
},
"responses": {
"201": {
"description": "Grant created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
}
}
}
}
}
}
}
},
"get": {
"tags": ["Grant"],
"operationId": "Get Grants",
"description": "",
"responses": {
"200": {
"description": "Grants retrieved successfully",
"headers": {
"X-Total-Count": {
"description": "Total number of Grants returned by the query",
"schema": {
"type": "integer",
"format": "int32"
}
}
},
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GrantMultiResponse"
}
}
}
}
},
"parameters": [
{
"in": "query",
"name": "offset",
"description": "Offset of the Grants (starting from 0) to include in the response.",
"schema": {
"type": "integer",
"format": "int32",
"default": 0
}
},
{
"in": "query",
"name": "limit",
"description": "Number of Grants to return. If unspecified, 10 max will be returned. Maximum value for limit can be 100",
"schema": {
"type": "integer",
"format": "int32",
"default": 10,
"maximum": 100
}
},
{
"in": "query",
"name": "status",
"description": "",
"required": false,
"schema": {
"$ref": "#/components/schemas/GrantStatusEnum"
}
}
]
}
},
"/v1/grants/{id}": {
"get": {
"tags": ["Grant"],
"operationId": "Get Grant",
"description": "",
"responses": {
"200": {
"description": "Grant retrieved successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GrantOutput"
}
}
}
},
"404": {
"description": "Grant not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StandardError"
}
}
}
}
},
"parameters": [
{
"in": "path",
"name": "id",
"required": true,
"description": "",
"schema": {
"type": "integer",
"format": "int32"
}
},
{
"in": "query",
"name": "status",
"description": "",
"required": false,
"schema": {
"$ref": "#/components/schemas/GrantStatusEnum"
}
}
]
}
}
},
"components": {
"parameters": {},
"schemas": {
"OrgInput": {
"type": "object",
"properties": {
"name": {
"description": "",
"type": "string"
},
"parentOrgId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
},
"users": {
"description": "",
"items": {
"type": "integer",
"format": "int32",
"example": "Link to User resource via its id"
},
"type": "array"
}
},
"required": ["name", "users"],
"description": "Organisation, Org for short is the top level resource to which all other resources have membership."
},
"OrgOutput": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
},
"name": {
"description": "",
"type": "string"
},
"parentOrgId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
},
"users": {
"description": "",
"items": {
"type": "integer",
"format": "int32",
"example": "Link to User resource via its id"
},
"type": "array"
}
},
"required": ["id", "name", "users"],
"description": "Organisation, Org for short is the top level resource to which all other resources have membership."
},
"OrgMultiResponse": {
"type": "object",
"properties": {
"orgs": {
"description": "Array of retrieved Orgs",
"type": "array",
"items": {
"$ref": "#/components/schemas/OrgOutput"
}
}
}
},
"OrgOwnedProjectInput": {
"type": "object",
"properties": {
"name": {
"description": "",
"type": "string"
},
"ownerOrgId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
}
},
"required": ["name", "ownerOrgId"],
"description": "A Project is owned by one Org Returns projects I own"
},
"OrgOwnedProjectOutput": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
},
"name": {
"description": "",
"type": "string"
},
"ownerOrgId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
}
},
"required": ["id", "name", "ownerOrgId"],
"description": "A Project is owned by one Org Returns projects I own"
},
"OrgOwnedProjectMultiResponse": {
"type": "object",
"properties": {
"ownedProjects": {
"description": "Array of retrieved Org::OwnedProjects",
"type": "array",
"items": {
"$ref": "#/components/schemas/OrgOwnedProjectOutput"
}
}
}
},
"OrgGrantedProjectOutput": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
},
"grantId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Grant resource via its id"
},
"grantStatus": {
"description": "",
"$ref": "#/components/schemas/GrantStatusEnum"
}
},
"required": ["id", "grantId", "grantStatus"]
},
"OrgGrantedProjectMultiResponse": {
"type": "object",
"properties": {
"grantedProjects": {
"description": "Array of retrieved Org::GrantedProjects",
"type": "array",
"items": {
"$ref": "#/components/schemas/OrgGrantedProjectOutput"
}
}
}
},
"UserInput": {
"type": "object",
"properties": {
"name": {
"description": "",
"type": "string"
}
},
"required": ["name"],
"description": "Users are members of an Organisation. They can be members of more than one Organisation\nUsers can be an Admin of only one Organisation"
},
"UserOutput": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
},
"name": {
"description": "",
"type": "string"
}
},
"required": ["id", "name"],
"description": "Users are members of an Organisation. They can be members of more than one Organisation\nUsers can be an Admin of only one Organisation"
},
"UserMultiResponse": {
"type": "object",
"properties": {
"users": {
"description": "Array of retrieved Users",
"type": "array",
"items": {
"$ref": "#/components/schemas/UserOutput"
}
}
}
},
"GrantInput": {
"type": "object",
"properties": {
"projectId": {
"description": "",
"items": {
"type": "integer",
"format": "int32"
},
"minItems": 2,
"maxItems": 2,
"type": "array",
"example": "Link to Org::OwnedProject resource via [orgId, ownedProjectId]"
},
"affiliateId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
}
},
"required": ["projectId", "affiliateId"],
"description": "A Grant allows temporary access to an Asset type"
},
"GrantOutput": {
"type": "object",
"properties": {
"id": {
"description": "",
"type": "integer",
"format": "int32"
},
"projectId": {
"description": "",
"items": {
"type": "integer",
"format": "int32"
},
"minItems": 2,
"maxItems": 2,
"type": "array",
"example": "Link to Org::OwnedProject resource via [orgId, ownedProjectId]"
},
"affiliateId": {
"description": "",
"type": "integer",
"format": "int32",
"example": "Link to Org resource via its id"
}
},
"required": ["id", "projectId", "affiliateId"],
"description": "A Grant allows temporary access to an Asset type"
},
"GrantMultiResponse": {
"type": "object",
"properties": {
"grants": {
"description": "Array of retrieved Grants",
"type": "array",
"items": {
"$ref": "#/components/schemas/GrantOutput"
}
}
}
},
"GrantStatusEnum": {
"type": "string",
"description": "Grant Status",
"enum": ["ACCEPTED", "PENDING", "REJECTED"]
},
"StandardError": {
"type": "object",
"properties": {
"httpStatus": {
"description": "HTTP error status code for this problem",
"type": "integer",
"format": "int32"
},
"errorCode": {
"description": "Service specific error code, more granular",
"type": "string"
},
"message": {
"description": "General, human readable error message",
"type": "string"
}
},
"required": ["httpStatus", "errorCode", "message"]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment