Skip to content

Instantly share code, notes, and snippets.

@cdcarter
Created January 4, 2016 22:18
Show Gist options
  • Save cdcarter/d0bf11b6521edadf72f1 to your computer and use it in GitHub Desktop.
Save cdcarter/d0bf11b6521edadf72f1 to your computer and use it in GitHub Desktop.
pm-swagger
{
"swagger": "2.0",
"info": {
"title": "Public Metrics",
"description": "Public Metrics creates public facing APIs and dashboards for key metrics tracked in Salesforce with a declarative and easy to set up process. This document defines the public API generated by the package.",
"version": "0.0.1"
},
"host": "public-metrics-1-developer-edition.na22.force.com",
"schemes": [
"https"
],
"basePath": "/publicmetrics/services/apexrest",
"produces": [
"application/json"
],
"paths": {
"/metrics/": {
"get": {
"summary": "Get a listing of all metrics available to the caller.",
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Metric"
}
}
},
"500": {
"description": "Unexpected error",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"/metrics/{short-name}": {
"get": {
"summary": "Get a specific metric",
"parameters": [
{
"name": "short-name",
"in": "path",
"type": "string",
"required": true,
"description": "the shortname of the specific metric you are requesting"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Metric"
}
},
"404": {
"description": "not found",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Error"
}
}
},
"500": {
"description": "unexpected error",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Error"
}
}
}
}
}
}
},
"definitions": {
"Error": {
"type": "object",
"properties": {
"errorCode": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"Metric": {
"type": "object",
"description": "A public metric and it's results",
"properties": {
"ShortName": {
"type": "string",
"description": "the unique json friendly 'short name' which identifies metric"
},
"Result": {
"type": "number",
"description": "the current value of this metric as of the Last Run"
},
"LastRun": {
"type": "string",
"format": "datetime",
"description": "The date and time this metric was last calculated"
},
"Unit": {
"type": "string",
"description": "a \"countable unit\" which can be displayed after the metric value"
},
"Type": {
"type": "string",
"description": "the format this result can be displayed as"
},
"Label": {
"type": "string",
"description": "a human readble label for the metric"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment