email: is the email used in the web to login. required.
password: is the password used in the web to login. required.
Return a manage object
manage.login()
Return a promise that resolve to:
{
"id":"xxxxxxx",
"created":"2017-02-20T23:24:34.939Z",
"activated":null,
"isAdmin":false,
"name":"Jose Perez",
"lastSeen":"2017-02-20T23:24:34.939Z",
"email":"myemail@example.com",
"tags":{},
"salesforce":null,
"features":null
}
You need to call this before other methods to make sure you are logged in. Re-login is automaticaly handled if you call a method and your session is expired.
manage.getWorkspaces()
Return a promise that resolve to an Array of workspaces:
[
{
"id":"xxxxxxxxx",
"version":2,
"created":"2017-02-20T23:24:35.365Z",
"slug":"test344",
"name":"Workspace Name1",
"salesforce":null,
"owners":[
"xxxxxxxx"
],
"features":null,
"readKeys":[
"read-123123-123123-1232-1232-123123123"
],
"environment":null,
"ids":null
},
{
"id":"yyyyyyy",
"version":2,
"created":"2017-02-21T12:59:20.221Z",
"slug":"test345",
"name":"test345",
"salesforce":null,
"owners":[
"xxxxxxxx"
],
"features":null,
"readKeys":[
"read-123123-123123-1232-1232-123123123"
],
"environment":null,
"ids":null
}
]
manage.createWorkspace(data)
data is the require object data to create a workspace.
name: Workspace name required
slug: Slug url required
billing: Object required
email: Manager Email address required
Return a promise that resolve to:
{
"id":"xxxxxxxxx",
"version":2,
"created":"2017-02-21T12:59:49.619Z",
"slug":"test344",
"name":"test344",
"salesforce":null,
"owners":[
"yyyyyyyy"
],
"features":null,
"readKeys":[
"read-123123-123123-1232-1232-123123123"
],
"environment":null,
"ids":null
}
manage.deleteWorkspace(data)
name: Workspace name required
Return a promise that resolve to:
HTTP 203 - Non-authoritative Information
manage.getSourceMetadata([sourceSlug])
Return a promise that resolve to an Array of available Sources or a specific source object if sourceSlug is provided.
Uses a PATCH request under the hood. This means the data can only contain
the desired changes.
workspaceSlug is the Workspace slug where you want to edit the source
sourceType is the source type
sourceSlug: slug of the source to update
data Object
name: a new name for the source.
enabled: Boolean.
{
"id":"tttttttt",
"created":"2017-02-21T13:26:28.951007525Z",
"createdBy":"",
"url":null,
"slug":"newslug",
"workspaceId":"gggggggg",
"lastSeen":"0001-01-01T00:00:00Z",
"collaborators":[],
"readKeys":[
"123123123123123123123123123"
],
"writeKeys":[
"34534534534534534534535345345"
],
"timezone":"America/Los_Angeles",
"name":"changedName",
"sourceId":"sourceID",
"enabled":true,
"settings":null,
"advancedSync":null,
"workspace":{
"id":"tttttttt",
"created":"2017-02-21T13:26:28.951007525Z",
"slug":"workspace-slug",
"name":"WorkspaceSlug",
"salesforce":null,
"owners":[
"xxxxxxxx"
],
"features":null,
"readKeys":[
"123123123123123123123123123"
],
"environment":null,
"ids":null
},
"hasSentData":true,
"integrations":[]
}
manage.getSources(workspaceSlug)
Return a promise that resolve to an array of your sources for the workspaceSlug provided.
[
{
"id":"xxxxxxx",
"version":2,
"created":"2017-02-21T13:26:28.951Z",
"createdBy":"",
"url":null,
"slug":"newslug",
"workspaceId":"yyyyyyyyy",
"lastSeen":"0001-01-01T00:00:00Z",
"collaborators":null,
"readKeys":[
"1231231231231231231231231231"
],
"writeKeys":[
"345345345345345345345353453451"
],
"plan":null,
"timezone":"America/Los_Angeles",
"name":"newname",
"sourceId":"U9mT0bPcI6",
"enabled":true,
"settings":null,
"advancedSync":null
},
{
"id":"zzzzzzzz",
"version":2,
"created":"2017-02-21T02:52:53.499Z",
"createdBy":"",
"url":null,
"slug":"nodejs",
"workspaceId":"yyyyyyy",
"lastSeen":"0001-01-01T00:00:00Z",
"collaborators":null,
"readKeys":[
"1231231231231231231231231232"
],
"writeKeys":[
"345345345345345345345353453452"
],
"plan":null,
"timezone":"America/Los_Angeles",
"name":"Nodejs",
"sourceId":"U9mT0bPcI6",
"enabled":true,
"settings":null,
"advancedSync":null
}
]
manage.getSource(workspaceSlug, name)
Return a promise that resolve to a source object in the workspaceSlug provided.
{
"id":"tttttttt",
"created":"2017-02-21T13:26:28.951007525Z",
"createdBy":"",
"url":null,
"slug":"newslug",
"workspaceId":"gggggggg",
"lastSeen":"0001-01-01T00:00:00Z",
"collaborators":[],
"readKeys":[
"123123123123123123123123123"
],
"writeKeys":[
"34534534534534534534535345345"
],
"timezone":"America/Los_Angeles",
"name":"changedName",
"sourceId":"sourceID",
"enabled":true,
"settings":null,
"advancedSync":null,
"workspace":{
"id":"tttttttt",
"created":"2017-02-21T13:26:28.951007525Z",
"slug":"workspace-slug",
"name":"WorkspaceSlug",
"salesforce":null,
"owners":[
"xxxxxxxx"
],
"features":null,
"readKeys":[
"123123123123123123123123123"
],
"environment":null,
"ids":null
},
"hasSentData":true,
"integrations":[]
}
manage.deleteSource(workspaceSlug, sourceSlug)
workspaceSlug: workspace slug
sourceSlug: slug of the source to delete
Return a promise that resolve to:
HTTP 203 - Non-authoritative Information
manage.getIntegrationMetadata([integrationSlug])
Return a promise that resolve to an Array of available Integrations or a specific integration object if integrationSlug is provided.
[
{
"name":"Gauges",
"slug":"gauges",
"version":"",
"createdAt":"2013-01-14T03:00:46Z",
"note":"",
"website":"http://gaug.es",
"description":"Gauges is a simple, friendly analytics tool that is perfect for the basic tracking needs of small projects or personal blogs. And all of it's data is queried in real-time.",
"description":"BIME helps you analyze and visualize the customer data you collect with Segment. Combine data, perform analysis, and share dashboards on the metrics you care about—no SQL required.",
"tagline":"Analyze and visualize customer data from your website, product, database, and many other sources.",