NAV Navbar
Logo
JSON Shell Javascript Python Ruby PHP Go C# Java

Moesif API Reference

Debugging RESTful APIs Made Easier.

This API reference centers around v1 of the Moesif REST APIs and API Client Libs for common languages. For an overview on Moesif and higher level SDKs for common frameworks, please checkout the Developer Docs

This RESTful API is open for developers who want to build new extensions and clients. Apps can integrate with Moesif as long as it can send HTTP requests.

Moesif on Programmable Web

There are two distinct APIs:

Name Host Authentication
Collector API api.moesif.net Retrieve your Collection Application Id from the Moesif portal under Installation menu and place in the request X-Moesif-Application-Id header. More info
Management API api.moesif.com Generate a Management API token under in the Moesif portal under Management API menu with the necessary resource scopes . Add it as a Bearer token to the request Authorization header. More info

Which should I use?

The Collector API is a write-only API and used for high-volume data ingestion from middleware SDKs and agents Think of it as a reverse CDN and used only for importing data into Moesif.

The Management API is for operations on the data stored already in Moesif. You can use it to query data for custom reports, build custom dashboards, integrate with other apps like bug tracking tools, etc.

Overview

Request Format

For POST, PUT, and PATCH requests, the request body should be JSON. The Content-Type header should be set to application/json

Response Format

The response body format is always JSON. Successful operations are seen via 2xx status code. Successful creation of new objects will be seen via 201. 4xx status implies client error.

The REST API JSON payloads uses underscore format (i.e some_key). Many of the API libs may use camelCase, PascalCase, or other as their model entities. Please select the respective language tab.

CORS

CORS is enabled on this API. Access-Control-Allow-Origin is set to *

Errors

Error Code Meaning
400 Bad Request – Your request has an incorrect parameter
401 Unauthorized – Your X-Moesif-Application-Id or Authorization header is incorrect
403 Forbidden – You accessed a resource not allowed with your key
404 Not Found – The specified resource could not be found
405 Method Not Allowed – You tried to access a resource with an invalid HTTP method
406 Not Acceptable – You requested a format that is not JSON format, Moesif’s API supports JSON
410 Gone – The resource requested has been removed from our servers
500 Internal Server Error – We had a problem with our server. Please contact us

API Libs

These open-source libs are advanced wrappers for the Moesif REST API and are the building blocks for the higher level server and mobile SDKs. These libs can be used similarly to other analytics event libs with a sendEvent() call which sends event data to api.moesif.net. These libraries support both sync and async operations.

Important

How to Install

Pick a language at the top


Source Code:

https://github.com/moesif/moesifapi-java
// Add the dependency

<dependency>
    <groupId>com.moesif.api</groupId>
    <artifactId>moesifapi</artifactId>
    <version>1.4.0</version>
</dependency>

Source Code:

https://github.com/moesif/moesifapi-nodejs


Package:

https://www.npmjs.com/package/moesifapi
// To Install Moesif Lib, run in your terminal

npm install --save moesifapi
Source Code:

https://github.com/moesif/moesifapi-python


Package:

https://pypi.python.org/pypi/moesifapi
# To Install Moesif Lib, run in your terminal

pip install moesifapi
Source Code:

https://github.com/moesif/moesifapi-ruby


Package:

https://rubygems.org/gems/moesif_api
# To Install Moesif Lib, run in your terminal

gem install moesif_api
Source Code:

https://github.com/moesif/moesifapi-csharp


Package:

https://www.nuget.org/packages/Moesif.Api/
// Install the Nuget Package via Package Manager Console:

Install-Package Moesif.Api
Source Code:

https://github.com/Moesif/moesifapi-go

go get github.com/moesif/moesifapi-go;
Source Code:

https://github.com/Moesif/moesifapi-php
// Install via Composer

composer require moesif/moesifapi

Select your language on the right:

The SDKs are open-source and available on GitHub.

Collector API v1

The Collector API is a high-volume, write-only distributed data collector. Think of it as a reverse CDN.

The Moesif middleware SDKs and agents such as moesif-express use the Collector API for sending event data to Moesif.

For API operations that are not API collection such as querying the data that’s accessible in the Moesif portal, look at the Management API.

Base URLs:

Terms of service

Prepend all endpoints below with this base url. Both HTTPS and HTTP requests are supported. Calls to our API are routed to the nearest datacenter.

Authentication

Authentication is done via HTTP Headers. The same Application Id token can be used for the cloud proxy server, the client libs, and the REST API. Add the following header to all API Calls.

X-Moesif-Application-Id: my_application_id

Events

Create an Event

POST https://api.moesif.net/v1/events

Log a single API event to Moesif. The request body itself is a single API Call object consisting of both the HTTP request and HTTP response.

POST https://api.moesif.net/v1/events

Example Request
  {
    "request": {
      "time": "2018-01-20T04:45:42.914",
      "uri": "https://api.acmeinc.com/items/12345/reviews/",
      "verb": "POST",
      "api_version": "1.1.0",
      "ip_address": "61.48.220.123",
      "headers": {
        "Host": "api.acmeinc.com",
        "Accept": "*/*",
        "Connection": "Keep-Alive",
        "Content-Type": "application/json",
        "Content-Length": "126",
        "Accept-Encoding": "gzip"
      },
      "body": {
        "items": [
          {
            "direction_type": 1,
            "item_id": "fwdsfrf",
            "liked": false
          },
          {
            "direction_type": 2,
            "item_id": "d43d3f",
            "liked": true
          }
        ]
      },
      "transfer_encoding": ""
    },
    "response": {
      "time": "2018-01-20T04:45:42.914",
      "status": 500,
      "headers": {
        "Vary": "Accept-Encoding",
        "Pragma": "no-cache",
        "Expires": "-1",
        "Content-Type": "application/json; charset=utf-8",
        "Cache-Control": "no-cache"
      },
      "body": {
        "Error": "InvalidArgumentException",
        "Message": "Missing field location"
      },
      "transfer_encoding": ""
    },
    "user_id": "mndug437f43",
    "session_token": "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f",
    "metadata": {
        "some_string": "I am a string",
        "some_int": 77,
        "some_object": {
            "some_sub_field": "some_value"
        }
    }
  }
# You can also use wget
curl -X GET https://api.moesif.net/v1/events \
  -H 'Accept: application/json' \
  -H 'X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID'


// Import the Library
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

// Generate the event
Map<String, String> reqHeaders = new HashMap<String, String>();
reqHeaders.put("Host", "api.acmeinc.com");
reqHeaders.put("Accept", "*/*");
reqHeaders.put("Connection", "Keep-Alive");
reqHeaders.put("User-Agent", "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)");
reqHeaders.put("Content-Type", "application/json");
reqHeaders.put("Content-Length", "126");
reqHeaders.put("Accept-Encoding", "gzip");

Object reqBody = APIHelper.deserialize("{" +
  "\"items\": [" +
    "{" +
      "\"type\": 1," +
      "\"id\": \"fwfrf\"" +,
    "}," +
    "{" +
      "\"type\": 2," +
       "\"id\": \"d43d3f\"" +
     "}" +
  "]" +
  "}");

Map<String, String> rspHeaders = new HashMap<String, String>();
rspHeaders.put("Vary", "Accept-Encoding");
rspHeaders.put("Pragma", "no-cache");
rspHeaders.put("Expires", "-1");
rspHeaders.put("Content-Type", "application/json; charset=utf-8");
rspHeaders.put("Cache-Control","no-cache");

Object rspBody = APIHelper.deserialize("{" +
    "\"Error\": \"InvalidArgumentException\"," +
    "\"Message\": \"Missing field field_a\"" +
  "}");


EventRequestModel eventReq = new EventRequestBuilder()
        .time(new Date())
        .uri("https://api.acmeinc.com/items/reviews/")
        .verb("PATCH")
        .apiVersion("1.1.0")
        .ipAddress("61.48.220.123")
        .headers(reqHeaders)
        .body(reqBody)
        .build();


EventResponseModel eventRsp = new EventResponseBuilder()
        .time(new Date(System.currentTimeMillis() + 1000))
        .status(500)
        .headers(rspHeaders)
        .body(rspBody)
        .build();

EventModel eventModel = new EventBuilder()
        .request(eventReq)
        .response(eventRsp)
        .userId("my_user_id")
        .sessionToken("23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f")
        .build();

// Asynchronous Call to Create Event
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

APICallBack<Object> callBack = new APICallBack<Object>() {
    public void onSuccess(HttpContext context, Object response) {
        // Do something
    }

    public void onFailure(HttpContext context, Throwable error) {
        // Do something else
    }
};

api.createEventsBatchAsync(eventsList, callBack);

// Synchronous Call to Create Event
api.createEventsBatch(eventsList, callBack);
// 1. Import the module
var moesifapi = require('moesifapi');
var api = moesifapi.ApiController;

// 2. Configure the ApplicationId
var config = moesifapi.configuration;
config.ApplicationId = "my_application_id";

// 3. Generate an API Event Model
var reqHeaders = JSON.parse('{' +
        '"Host": "api.acmeinc.com",' +
        '"Accept": "*/*",' +
        '"Connection": "Keep-Alive",' +
        '"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)",' +
        '"Content-Type": "application/json",' +
        '"Content-Length": "126",' +
        '"Accept-Encoding": "gzip"' +
    '}');

var reqBody = JSON.parse( '{' +
        '"items": [' +
            '{' +
                '"type": 1,' +
                '"id": "fwfrf"' +
            '},' +
            '{' +
                '"type": 2,' +
                '"id": "d43d3f"' +
            '}' +
        ']' +
    '}');

var rspHeaders = JSON.parse('{' +
        '"Vary": "Accept-Encoding",' +
        '"Pragma": "no-cache",' +
        '"Expires": "-1",' +
        '"Content-Type": "application/json; charset=utf-8",' +
        '"Cache-Control": "no-cache"' +
    '}');

var rspBody = JSON.parse('{' +
        '"Error": "InvalidArgumentException",' +
        '"Message": "Missing field field_a"' +
    '}');

var reqDate = new Date();
var eventReq = {
    time: reqDate,
    uri: "https://api.acmeinc.com/items/reviews/",
    verb: "PATCH",
    apiVersion: "1.1.0",
    ipAddress: "61.48.220.123",
    headers: reqHeaders,
    body: reqBody
};

var eventRsp = {
    time: (new Date()).setMilliseconds(reqDate.getMilliseconds() + 500),
    status: 500,
    headers: rspHeaders,
    body: rspBody
};

var eventModel = {
    request: eventReq,
    response: eventRsp,
    userId: "my_user_id",
    sessionToken: "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f"
};

var events = [new EventModel(eventModel),
  new EventModel(eventModel),
  new EventModel(eventModel),
  new EventModel(eventModel)];

// 4. Send batch of events
api.createEventsBatch(events, function(error, response, context) {
  // Do Something
});

from __future__ import print_function
from moesifapi.moesif_api_client import *
from moesifapi.models import *
from datetime import *

client = MoesifAPIClient(my_application_id)
api = client.api

# Note: we recommend sending all API Calls via MVC framework middleware.

req_headers = APIHelper.json_deserialize("""  {
  "Host": "api.acmeinc.com",
  "Accept": "*/*",
  "Connection": "Keep-Alive",
  "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)",
  "Content-Type": "application/json",
  "Content-Length": "126",
  "Accept-Encoding": "gzip"
} """)

req_body = APIHelper.json_deserialize( """{
  "items": [
    {
      "type": 1,
      "id": "fwfrf"
    },
    {
      "type": 2,
      "id": "d43d3f"
    }
  ]
}""")

rsp_headers = APIHelper.json_deserialize("""  {
    "Date": "Tue, 20 Jan 2018 23:46:49 GMT",
    "Vary": "Accept-Encoding",
    "Pragma": "no-cache",
    "Expires": "-1",
    "Content-Type": "application/json; charset=utf-8"
    "Cache-Control": "no-cache"
  } """)

rsp_body = APIHelper.json_deserialize( """{
    "Error": "InvalidArgumentException",
    "Message": "Missing field field_a"
  }""")


event_req = EventRequestModel(time = datetime.utcnow() - timedelta(seconds=-1),
    uri = "https://api.acmeinc.com/items/reviews/",
    verb = "PATCH",
    api_version = "1.1.0",
    ip_address = "61.48.220.123",
    headers = req_headers,
    body = req_body)

event_rsp = EventResponseModel(time = datetime.utcnow(),
    status = 500,
    headers = rsp_headers,
    body = rsp_body)

event_model = EventModel(request = event_req,
    response = event_rsp,
    user_id = "my_user_id",
    session_token = "my_application_id")


# Perform the API call through the SDK function
api.create_event(event_model)
require 'moesif_api'

client = MoesifApi::MoesifAPIClient.new(my_application_id)
api = client.api_controller

req_headers = JSON.parse('{'\
  '"Host": "api.acmeinc.com",'\
  '"Accept": "*/*",'\
  '"Connection": "Keep-Alive",'\
  '"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)",'\
  '"Content-Type": "application/json",'\
  '"Content-Length": "126",'\
  '"Accept-Encoding": "gzip"'\
'}')

req_body = JSON.parse( '{'\
  '"items": ['\
    '{'\
      '"type": 1,'\
      '"id": "fwfrf"'\
    '},'\
    '{'\
      '"type": 2,'\
      '"id": "d43d3f"'\
    '}'\
  ']'\
'}')

rsp_headers = JSON.parse('{'\
  '"Date": "Tue, 20 Jan 2018 23:46:49 GMT",'\
                '"Vary": "Accept-Encoding",'\
  '"Pragma": "no-cache",'\
  '"Expires": "-1",'\
  '"Content-Type": "application/json; charset=utf-8",'\
                '"Cache-Control": "no-cache"'\
'}')

rsp_body = JSON.parse('{'\
  '"Error": "InvalidArgumentException",'\
  '"Message": "Missing field field_a"'\
'}')


event_req = EventRequestModel.new()
event_req.time = "2018-01-20T04:45:42.914"
event_req.uri = "https://api.acmeinc.com/items/reviews/"
event_req.verb = "PATCH"
event_req.api_version = "1.1.0"
event_req.ip_address = "61.48.220.123"
event_req.headers = req_headers
event_req.body = req_body

event_rsp = EventResponseModel.new()
event_rsp.time = "2018-01-20T04:45:42.914"
event_rsp.status = 500
event_rsp.headers = rsp_headers
event_rsp.body = rsp_body

event_model = EventModel.new()
event_model.request = event_req
event_model.response = event_rsp
event_model.user_id ="my_user_id"
event_model.session_token = "my_application_id"

# Perform the API call through the SDK function
response = api.create_event(event_model)

using Moesif.Api;
using Moesif.Api.Helpers;

// Create client instance using your ApplicationId
var client = new MoesifAPIClient("my_application_id");
var apiClient = GetClient().Api;

// Parameters for the API call
var reqHeaders = APIHelper.JsonDeserialize<object>(@" {
        ""Host"": ""api.acmeinc.com"",
        ""Accept"": ""*/*"",
        ""Connection"": ""Keep-Alive"",
        ""User-Agent"": ""Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)"",
        ""Content-Type"": ""application/json"",
        ""Content-Length"": ""126"",
        ""Accept-Encoding"": ""gzip""
    }");

var reqBody = APIHelper.JsonDeserialize<object>(@" {
        ""items"": [
            {
                ""type"": 1,
                ""id"": ""fwfrf""
            },
            {
                ""type"": 2,
                ""id"": ""d43d3f""
            }
        ]
    }");

var rspHeaders = APIHelper.JsonDeserialize<object>(@" {
        ""Date"": ""Tue, 20 Jan 2018 23:46:49 GMT"",
        ""Vary"": ""Accept-Encoding"",
        ""Pragma"": ""no-cache"",
        ""Expires"": ""-1"",
        ""Content-Type"": ""application/json; charset=utf-8"",
        ""Cache-Control"": ""no-cache""
    } ");

var rspBody = APIHelper.JsonDeserialize<object>(@" {
        ""Error"": ""InvalidArgumentException"",
        ""Message"": ""Missing field field_a""
    }");


var eventReq = new EventRequestModel()
{
    Time = DateTime.Parse("2018-01-20T04:45:42.914"),
    Uri = "https://api.acmeinc.com/items/reviews/",
    Verb = "PATCH",
    ApiVersion = "1.1.0",
    IpAddress = "61.48.220.123",
    Headers = reqHeaders,
    Body = reqBody
};

var eventRsp = new EventResponseModel()
{
    Time = DateTime.Parse("2018-01-20T04:45:42.914"),
    Status = 500,
    Headers = rspHeaders,
    Body = rspBody
};

var eventModel = new EventModel()
{
    Request = eventReq,
    Response = eventRsp,
    UserId = "my_user_id",
    SessionToken = "my_application_id"
};

//////////////////////////////////////
// Example for making an async call //     
//////////////////////////////////////
try
{
    await controller.CreateEventAsync(eventModel);
}
catch(APIException)
{
    // Handle Error
};

///////////////////////////////////////////
// Example for making a synchronous call //
///////////////////////////////////////////
try
{
    controller.CreateEvent(eventModel);
}
catch(APIException)
{
    // Handle Error
};

import "github.com/moesif/moesifapi-go"
import "github.com/moesif/moesifapi-go/models"
import "time"

apiClient := moesifapi.NewAPI("your_moesif_application_id")

reqTime := time.Now().UTC()
apiVersion := "1.0"
ipAddress := "61.48.220.123"

req := models.EventRequestModel{
  Time:       &reqTime,
  Uri:        "https://api.acmeinc.com/widgets",
  Verb:       "GET",
  ApiVersion: &apiVersion,
  IpAddress:  &ipAddress,
  Headers: map[string]interface{}{
    "ReqHeader1": "ReqHeaderValue1",
  },
  Body: nil,
}

rspTime := time.Now().UTC().Add(time.Duration(1) * time.Second)

rsp := models.EventResponseModel{
  Time:      &rspTime,
  Status:    500,
  IpAddress: nil,
  Headers: map[string]interface{}{
    "RspHeader1":     "RspHeaderValue1",
    "Content-Type":   "application/json",
    "Content-Length": "1000",
  },
  Body: map[string]interface{}{
    "Key1": "Value1",
    "Key2": 12,
    "Key3": map[string]interface{}{
      "Key3_1": "SomeValue",
    },
  },
}

sessionToken := "end user's API or Session Token"
userId := "end user_id"

event := models.EventModel{
  Request:      req,
  Response:     rsp,
  SessionToken: &sessionToken,
  Tags:         nil,
  UserId:       &userId,
}


// Queue the event (will queue the requests into batches and flush buffers periodically.)
err := apiClient.QueueEvent(&event)

// Create the event synchronously
err := apiClient.CreateEvent(&event)

<?php
// Depending on your project setup, you might need to include composer's
// autoloader in your PHP code to enable autoloading of classes.

require_once "vendor/autoload.php";

// Import the SDK client in your project:

use MoesifApi\MoesifApiClient;

// Instantiate the client. After this, you can now access the Moesif API
// and call the respective methods:

$client = new MoesifApiClient("Your application Id");
$api = $client->getApi();

$event = APIHelper::deserialize('{ "request": { "time": "2016-09-09T04:45:42.914", "uri": "<https://api.acmeinc.com/items/reviews/>", "verb": "PATCH", "api_version": "1.1.0", "ip_address": "61.48.220.123", "headers": { "Host": "api.acmeinc.com", "Accept": "_/_", "Connection": "Keep-Alive", "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)", "Content-Type": "application/json", "Content-Length": "126", "Accept-Encoding": "gzip" }, "body": { "items": [ { "direction_type": 1, "discovery_id": "fwfrf", "liked": false }, { "direction_type": 2, "discovery_id": "d43d3f", "liked": true } ] } }, "response": { "time": "2016-09-09T04:45:42.914", "status": 500, "headers": { "Date": "Tue, 23 Aug 2016 23:46:49 GMT", "Vary": "Accept-Encoding", "Pragma": "no-cache", "Expires": "-1", "Content-Type": "application/json; charset=utf-8", "X-Powered-By": "ARR/3.0", "Cache-Control": "no-cache", "Arr-Disable-Session-Affinity": "true" }, "body": { "Error": "InvalidArgumentException", "Message": "Missing field field_a" } }, "user_id": "mndug437f43", "session_token": "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f", "metadata": { "foo": "bar" } }', new Models\EventModel());

// Note: If the request.time is in the past, it can only be backdated up to 7 days.

$reqdate = new DateTime();
$event->request->time = $reqdate->format(DateTime::ISO8601);
$rspdate = new DateTime();
$event->response->time = $rspdate->format(DateTime::ISO8601);

$api->createEvent($event);
Name Required Description
request true The object that specifies the request message

request.time

true Timestamp for the request in ISO 8601 format

request.uri

true Full uri such as https://api.com/?query=string including host, query string, etc

request.verb

true HTTP method used, i.e. GET, POST

request.api_version

false API Version you want to tag this request with such as 1.0.0

request.ip_address

false IP address of the requester, If not set, we use the IP address of your logging API calls.

request.headers

true Headers of the request as a Map<string, string>.. Multiple headers with the same key name should be combined together such that the values are joined by a comma. HTTP Header Protocol on w3.org

request.body

false Body of the request in JSON format or Base64 encoded binary data (see transfer_encoding)

request.transfer_encoding

false A string that specifies the transfer encoding of Body being sent to Moesif. If field nonexistent, body assumed to be JSON or text. Only possible value is base64 for sending binary data like protobuf
response false The object that specifies the response message, not set implies no response received such as a timeout.

response.time

true Timestamp for the response in ISO 8601 format

response.status

true HTTP status code as number such as 200 or 500

request.ip_address

false IP address of the responding server

response.headers

true Headers of the response as a Map<string, string>. Multiple headers with the same key name should be combined together such that the values are joined by a comma. HTTP Header Protocol on w3.org

response.body

false Body of the response in JSON format or Base64 encoded binary data (see transfer_encoding)

response.transfer_encoding

false A string that specifies the transfer encoding of Body being sent to Moesif. If field nonexistent, body assumed to be JSON or text. Only possible value is base64 for sending binary data like protobuf
session_token Recommend The end user session token such as a JWT or API key, which may or may not be temporary. Moesif will auto-detect the session token automatically if not set.
user_id Recommend Identifies this API call to a permanent user_id
metadata false A JSON Object consisting of any custom metadata to be stored with this event.

Create an Events Batch

POST https://api.moesif.net/v1/events/batch

Creates and logs a batch of API Calls to Moesif. The request body itself is an array API Calls object consisting of both the HTTP request and HTTP response.

This API takes a list form of the same model defined in create single event.

The maximum batch size is 12MB. Break up larger batches.

API Calls from multiple end users can be added in a single batch. Each Event in the list has independent session_token and user_id fields.

POST https://api.moesif.net/v1/events/batch

Example Request
  [
    {
        "request": {
          "time": "2018-01-20T04:45:42.914",
          "uri": "https://api.acmeinc.com/items/83738/reviews/",
          "verb": "POST",
          "api_version": "1.1.0",
          "ip_address": "61.48.220.123",
          "headers": {
            "Host": "api.acmeinc.com",
            "Accept": "*/*",
            "Connection": "Keep-Alive",
            "Content-Type": "application/json",
            "Content-Length": "126",
            "Accept-Encoding": "gzip"
          },
          "body": {
            "items": [
              {
                "direction_type": 1,
                "item_id": "fwdsfrf",
                "liked": false
              },
              {
                "direction_type": 2,
                "item_id": "d43d3f",
                "liked": true
              }
            ]
          },
          "transfer_encoding": "",
        },
        "response": {
          "time": "2018-01-20T04:45:42.914",
          "status": 500,
          "headers": {
            "Vary": "Accept-Encoding",
            "Pragma": "no-cache",
            "Expires": "-1",
            "Content-Type": "application/json; charset=utf-8",
            "Cache-Control": "no-cache"
          },
          "body": {
            "Error": "InvalidArgumentException",
            "Message": "Missing field location"
          },
          "transfer_encoding": "",
        },
        "user_id": "mndug437f43",
        "session_token": "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f",
        "metadata": {
            "some_string": "I am a string",
            "some_int": 77,
            "some_object": {
                "some_sub_field": "some_value"
            }
        }
    }
  ]
# You can also use wget
curl -X GET https://api.moesif.net/v1/events/batch \
  -H 'Accept: application/json' \
  -H 'X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID'


// Import the Library
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

// Generate the events
Map<String, String> reqHeaders = new HashMap<String, String>();
reqHeaders.put("Host", "api.acmeinc.com");
reqHeaders.put("Accept", "*/*");
reqHeaders.put("Connection", "Keep-Alive");
reqHeaders.put("User-Agent", "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)");
reqHeaders.put("Content-Type", "application/json");
reqHeaders.put("Content-Length", "126");
reqHeaders.put("Accept-Encoding", "gzip");

Object reqBody = APIHelper.deserialize("{" +
  "\"items\": [" +
    "{" +
      "\"type\": 1," +
      "\"id\": \"fwfrf\"" +
    "}," +
    "{" +
      "\"type\": 2," +
      "\"id\": \"d43d3f\"" +
    "}" +
  "]" +
  "}");

Map<String, String> rspHeaders = new HashMap<String, String>();
rspHeaders.put("Date", "Tue, 20 Jan 2018 23:46:49 GMT");
rspHeaders.put("Vary", "Accept-Encoding");
rspHeaders.put("Pragma", "no-cache");
rspHeaders.put("Expires", "-1");
rspHeaders.put("Content-Type", "application/json; charset=utf-8");
rspHeaders.put("Cache-Control","no-cache");

Object rspBody = APIHelper.deserialize("{" +
    "\"Error\": \"InvalidArgumentException\"," +
    "\"Message\": \"Missing field field_a\"" +
  "}");


EventRequestModel eventReq = new EventRequestBuilder()
        .time(new Date())
        .uri("https://api.acmeinc.com/items/reviews/")
        .verb("PATCH")
        .apiVersion("1.1.0")
        .ipAddress("61.48.220.123")
        .headers(reqHeaders)
        .body(reqBody)
        .build();


EventResponseModel eventRsp = new EventResponseBuilder()
        .time(new Date(System.currentTimeMillis() + 1000))
        .status(500)
        .headers(rspHeaders)
        .body(rspBody)
        .build();

EventModel eventModel = new EventBuilder()
        .request(eventReq)
        .response(eventRsp)
        .userId("my_user_id")
        .sessionToken("23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f")
        .build();

List<EventModel> events = new ArrayList<EventModel>();
events.add(eventModel);
events.add(eventModel);
events.add(eventModel);
events.add(eventModel);

// Asynchronous Call to create new event
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

APICallBack<Object> callBack = new APICallBack<Object>() {
    public void onSuccess(HttpContext context, Object response) {
      // Do something
    }

    public void onFailure(HttpContext context, Throwable error) {
      // Do something else
    }
};

api.createEventsBatchAsync(events, callBack);

// Synchronous Call to create new event
api.createEventsBatch(events, callBack);
// Import the module:
var moesifapi = require('moesifapi');

// Set your application id
var config = moesifapi.configuration;
config.ApplicationId = 'my_application_id';

// Create API Event Models and set fields
var reqHeaders = JSON.parse('{' +
        '"Host": "api.acmeinc.com",' +
        '"Accept": "*/*",' +
        '"Connection": "Keep-Alive",' +
        '"User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)",' +
        '"Content-Type": "application/json",' +
        '"Content-Length": "126",' +
        '"Accept-Encoding": "gzip"' +
    '}');

var reqBody = JSON.parse( '{' +
        '"items": [' +
            '{' +
                '"type": 1,' +
                '"id": "fwfrf"' +
            '},' +
            '{' +
                '"type": 2,' +
                '"id": "d43d3f"' +
            '}' +
        ']' +
    '}');

var rspHeaders = JSON.parse('{' +
        '"Vary": "Accept-Encoding",' +
        '"Pragma": "no-cache",' +
        '"Expires": "-1",' +
        '"Content-Type": "application/json; charset=utf-8",' +
        '"Cache-Control": "no-cache"' +
    '}');

var rspBody = JSON.parse('{' +
        '"Error": "InvalidArgumentException",' +
        '"Message": "Missing field field_a"' +
    '}');

var reqDate = new Date();
var eventReq = {
    time: reqDate,
    uri: "https://api.acmeinc.com/items/reviews/",
    verb: "PATCH",
    apiVersion: "1.1.0",
    ipAddress: "61.48.220.123",
    headers: reqHeaders,
    body: reqBody
};

var eventRsp = {
    time: (new Date()).setMilliseconds(reqDate.getMilliseconds() + 500),
    status: 500,
    headers: rspHeaders,
    body: rspBody
};

var eventA = {
    request: eventReq,
    response: eventRsp,
    userId: "my_user_id",
    sessionToken: "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f"
};

var myEventModels = [ eventA ]

//Access various controllers by:
var controller = moesifapi.ApiController;

// Send the actual events
controller.createEventsBatch(myEventModels, function(error, response, context) {
  //  Handle Errors
});

from __future__ import print_function
from moesifapi.moesif_api_client import *
from moesifapi.models import *
from datetime import *

# Setup API Client
client = MoesifAPIClient(my_application_id)
api = client.api_controller


# Create API Event Models and set fields
req_headers = APIHelper.json_deserialize("""  {
  "Host": "api.acmeinc.com",
  "Accept": "*/*",
  "Connection": "Keep-Alive",
  "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)",
  "Content-Type": "application/json",
  "Content-Length": "126",
  "Accept-Encoding": "gzip"
} """)

req_body = APIHelper.json_deserialize( """{
  "items": [
    {
      "type": 1,
      "id": "fwfrf"
    },
    {
      "type": 2,
      "id": "d43d3f"
    }
  ]
}""")

rsp_headers = APIHelper.json_deserialize("""  {
    "Date": "Tue, 20 Jan 2018 23:46:49 GMT",
    "Vary": "Accept-Encoding",
    "Pragma": "no-cache",
    "Expires": "-1",
    "Content-Type": "application/json; charset=utf-8"
    "Cache-Control": "no-cache"
  } """)

rsp_body = APIHelper.json_deserialize( """{
    "Error": "InvalidArgumentException",
    "Message": "Missing field field_a"
  }""")


event_req = EventRequestModel(time = datetime.utcnow() - timedelta(seconds=-1),
    uri = "https://api.acmeinc.com/items/reviews/",
    verb = "PATCH",
    api_version = "1.1.0",
    ip_address = "61.48.220.123",
    headers = req_headers,
    body = req_body)

event_rsp = EventResponseModel(time = datetime.utcnow(),
    status = 500,
    headers = rsp_headers,
    body = rsp_body)

event_a = EventModel(request = event_req,
    response = event_rsp,
    user_id = "my_user_id",
    session_token = "my_application_id")

my_events = [ event_a ]

# Send the actual events
api.create_events_batch(my_events)

require 'moesif_api'

# Setup API Client
client = MoesifApi::MoesifAPIClient.new(my_application_id)
api = client.api_controller

# Create API Event Models and set fields
event_a = EventModel.new()
event_a.user_id = "my user id" #  ...
my_event_models = [ event_a ]

# Send the actual events
api.create_events_batch(my_event_models)

using Moesif.Api;
using Moesif.Api.Helpers;

// Create client instance using your ApplicationId
var client = new MoesifAPIClient("my_application_id");
var apiClient = GetClient().Api;

// Parameters for the API call
var reqHeaders = APIHelper.JsonDeserialize<object>(@" {
        ""Host"": ""api.acmeinc.com"",
        ""Accept"": ""*/*"",
        ""Connection"": ""Keep-Alive"",
        ""User-Agent"": ""Dalvik/2.1.0 (Linux; U; Android 5.0.2; C6906 Build/14.5.A.0.242)"",
        ""Content-Type"": ""application/json"",
        ""Content-Length"": ""126"",
        ""Accept-Encoding"": ""gzip""
    }");

var reqBody = APIHelper.JsonDeserialize<object>(@" {
        ""items"": [
            {
                ""type"": 1,
                ""id"": ""fwfrf""
            },
            {
                ""type"": 2,
                ""id"": ""d43d3f""
            }
        ]
    }");

var rspHeaders = APIHelper.JsonDeserialize<object>(@" {
        ""Date"": ""Tue, 20 Jan 2018 23:46:49 GMT"",
        ""Vary"": ""Accept-Encoding"",
        ""Pragma"": ""no-cache"",
        ""Expires"": ""-1"",
        ""Content-Type"": ""application/json; charset=utf-8"",
        ""Cache-Control"": ""no-cache""
    } ");

var rspBody = APIHelper.JsonDeserialize<object>(@" {
        ""Error"": ""InvalidArgumentException"",
        ""Message"": ""Missing field field_a""
    }");

var reqDate = new Date();
var eventReq = new EventRequestModel()
{
    Time = DateTime.Parse("2018-01-20T04:45:42.914"),
    Uri = "https://api.acmeinc.com/items/reviews/",
    Verb = "PATCH",
    ApiVersion = "1.1.0",
    IpAddress = "61.48.220.123",
    Headers = reqHeaders,
    Body = reqBody
};

var eventRsp = new EventResponseModel()
{
    Time = DateTime.Parse("2018-01-20T04:45:42.914"),
    Status = 500,
    Headers = rspHeaders,
    Body = rspBody
};

var eventModel = new EventModel()
{
    Request = eventReq,
    Response = eventRsp,
    UserId = "my_user_id",
    SessionToken = "my_application_id"
};

// Create a List
var events = new List<EventModel>();
events.Add(eventModel);
events.Add(eventModel);
events.Add(eventModel);

//////////////////////////////////////
// Example for making an async call //  
//////////////////////////////////////
try
{
    await controller.CreateEventsBatchAsync(events);
}
catch(APIException)
{
    // Handle Error
};

///////////////////////////////////////////
// Example for making a synchronous call //
///////////////////////////////////////////
try
{
    controller.CreateEventsBatch(events);
}
catch(APIException)
{
    // Handle Error
};

import "github.com/moesif/moesifapi-go"
import "github.com/moesif/moesifapi-go/models"
import "time"

apiClient := moesifapi.NewAPI("my_application_id")

reqTime := time.Now().UTC()
apiVersion := "1.0"
ipAddress := "61.48.220.123"

req := models.EventRequestModel{
  Time:       &reqTime,
  Uri:        "https://api.acmeinc.com/widgets",
  Verb:       "GET",
  ApiVersion: &apiVersion,
  IpAddress:  &ipAddress,
  Headers: map[string]interface{}{
    "ReqHeader1": "ReqHeaderValue1",
  },
  Body: nil,
}

rspTime := time.Now().UTC().Add(time.Duration(1) * time.Second)

rsp := models.EventResponseModel{
  Time:      &rspTime,
  Status:    500,
  IpAddress: nil,
  Headers: map[string]interface{}{
    "RspHeader1": "RspHeaderValue1",
  },
  Body: map[string]interface{}{
    "Key1": "Value1",
    "Key2": 12,
    "Key3": map[string]interface{}{
      "Key3_1": "SomeValue",
    },
  },
}

sessionToken := "end user API or session token"
userId := "end user_id"

event := models.EventModel{
  Request:      req,
  Response:     rsp,
  SessionToken: &sessionToken,
  Tags:         nil,
  UserId:       &userId,
}

events := make([]*models.EventModel, 20)
for i := 0; i < 20; i++ {
  events[i] = &event
}

// Queue the events
err := apiClient.QueueEvents(events)

// Create the events batch synchronously
err := apiClient.CreateEventsBatch(event)

<?php
// Depending on your project setup, you might need to include composer's
// autoloader in your PHP code to enable autoloading of classes.

require_once "vendor/autoload.php";

// Import the SDK client in your project:

use MoesifApi\MoesifApiClient;

// Instantiate the client. After this, you can now access the Moesif API
// and call the respective methods:

$client = new MoesifApiClient("Your application Id");
$api = $client->getApi();
Name Required Description
request true The object that specifies the request message

request.time

true Timestamp for the request in ISO 8601 format

request.uri

true Full uri such as https://api.com/?query=string including host, query string, etc

request.verb

true HTTP method used, i.e. GET, POST

request.api_version

false API Version you want to tag this request with such as 1.0.0

request.ip_address

false IP address of the requester, If not set, we use the IP address of your logging API calls.

request.headers

true Headers of the request as a Map<string, string>. Multiple headers with the same key name should be combined together such that the values are joined by a comma. HTTP Header Protocol on w3.org

request.body

false Body of the request in JSON format or Base64 encoded binary data (see transfer_encoding)

request.transfer_encoding

false A string that specifies the transfer encoding of Body being sent to Moesif. If field nonexistent, body assumed to be JSON or text. Only possible value is base64 for sending binary data like protobuf
response false The object that specifies the response message, not set implies no response received such as a timeout.

response.time

true Timestamp for the response in ISO 8601 format

response.status

true HTTP status code as number such as 200 or 500

request.ip_address

false IP address of the responding server

response.headers

true Headers of the response as a Map<string, string>. Multiple headers with the same key name should be combined together such that the values are joined by a comma. HTTP Header Protocol on w3.org

response.body

false Body of the response in JSON format or Base64 encoded binary data (see transfer_encoding)

response.transfer_encoding

false A string that specifies the transfer encoding of Body being sent to Moesif. If field nonexistent, body assumed to be JSON or text. Only possible value is base64 for sending binary data like protobuf
session_token Recommend The end user session token such as a JWT or API key, which may or may not be temporary. Moesif will auto-detect the session token automatically if not set.
user_id Recommend Identifies this API call to a permanent user_id
metadata false A JSON Object consisting of any custom metadata to be stored with this event.

Users

Update a User

POST https://api.moesif.net/v1/users

Updates an end user profile in Moesif.

A custom JSON object can be placed in the metadata object which will be stored as part of the user profile.

If present, Moesif will detect special metadata fields like:

Updating an end user will create one if it does not exist, also know as upsert If a user exists, it will be merged on top of existing fields. Any new field set will override the existing fields. This is done via recursive merge which merges inner objects.

POST https://api.moesif.net/v1/users

Example Request
  {
    "modified_time": "2018-01-20T04:45:42.914",
    "ip_address": "61.48.220.123",
    "session_token": "df32dkj32opxzfdmji4hf4fs98y18cx98q3yhwmnhcfx43f",
    "user_id": "123456",
    "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
    "metadata": {
      "first_name": "John",
      "last_name": "Doe",
      "email": "john@gmail.com",
      "phone": "123-456-7890",
      "custom_string_field": "some_value",
      "custom_int_field": 55,
      "custom_obj_field": {
          "sub_a": "value_a",
          "sub_b": "value_b"
      }
    }
  }

# You can also use wget
curl -X GET https://api.moesif.net/v1/users \
  -H 'Accept: application/json' \
  -H 'X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID'


// 1. Import the module
var moesifapi = require('moesifapi');
var api = moesifapi.ApiController;

// 2. Configure the ApplicationId
var config = moesifapi.configuration;
config.ApplicationId = "my_application_id";

// 3. Generate a User Model
var user = {
    userId: "my_user_id",
    sessionToken: "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f",
    metadata: {
      email: "johndoe@acmeinc.com",
      string_field: "value_1",
      number_field: 0,
      object_field: {
        field_a: "value_a",
        field_b: "value_b"
      }
    }
};

// 4. Create a single user
api.updateUser(new UserModel(user), function(error, response, context) {
  // Do Something
});
from __future__ import print_function
from moesifapi.moesif_api_client import *
from moesifapi.models import *
from datetime import *

client = MoesifAPIClient(my_application_id)
api = client.api

metadata = APIHelper.json_deserialize("""  {
        "email": "pythonapiuser@email.com",
        "name": "pythonapiuser",
        "custom_field": "testdata"
    } """)

user_model = UserModel(
    user_id = 'ihjdewhdiew',
    modified_time = datetime.utcnow(),
    metadata = metadata)

# Perform the API call through the SDK function
api.update_user(user_model)
client = MoesifApi::MoesifAPIClient.new(my_application_id)
api = client.api

metadata = JSON.parse('{'\
  '"email": "testrubyapi@user.com",'\
  '"name": "ruby api user",'\
  '"custom": "testdata"'\
'}')

user_model = UserModel.new()
user_model.modified_time = Time.now.utc.iso8601  # option, default now.
user_model.user_id = "testrubyapiuser"  #only required field.
user_model.metadata = metadata

response = api.update_user(user_model)
<?php
// Depending on your project setup, you might need to include composer's
// autoloader in your PHP code to enable autoloading of classes.

require_once "vendor/autoload.php";

// Import the SDK client in your project:

use MoesifApi\MoesifApiClient;

// Instantiate the client. After this, you can now access the Moesif API
// and call the respective methods:

$client = new MoesifApiClient("Your application Id");
$api = $client->getApi();

$user = new Models\UserModel();

$user->userId = "moesifphpuser";
$user->metadata = [
  "email" => "moesifphp@email.com",
  "name" => "moesif php",
  "custom" => "randomdata"
];

$api->updateUser($user);
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

UserModel user = new UserBuilder()
    .userId("12345")
    .modifiedTime(new Date())
    .ipAddress("29.80.250.240")
    .sessionToken("di3hd982h3fubv3yfd94egf")
    .userAgentString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36")
    .metadata(APIHelper.deserialize("{" +
        "\"email\": \"johndoe@acmeinc.com\"," +
        "\"string_field\": \"value_1\"," +
        "\"number_field\": 0," +
        "\"object_field\": {" +
          "\"field_1\": \"value_1\"," +
          "\"field_2\": \"value_2\"" +
        "}" +
      "}"))
     .build();

// Asynchronous Call to update user
APICallBack<Object> callBack = new APICallBack<Object>() {
    public void onSuccess(HttpContext context, Object response) {
      // Do something
    }

    public void onFailure(HttpContext context, Throwable error) {
      // Do something else
    }
};

api.updateUserAsync(user, callBack);

// Synchronous Call to update user
api.updateUser(user, callBack);

user_id vs. session_token

Users in Moesif are identified by two attributes: user_id and session_token.

Name Required Description
user_id true Your application’s user_id to identify this user.
modified_time false Last Modified Timestamp for the user in ISO 8601 format (Set automatically if not provided).
ip_address false Current IP address of the user, If not set, we use the IP address of the POST request.
session_token false Current end user session or API token such as a JWT. Setting this field does not remove old session tokens previously stored. Instead, Moesif will append the new value to an alias table for this user_id.
user_agent_string false If you want Moesif to parse a user agent string, you can do so via user_agent_string.
metadata false A JSON Object consisting of any custom metadata to be stored with this user.

Update Users in Batch

POST https://api.moesif.net/v1/users/batch

Updates a list of end user profile in Moesif.

A custom JSON object can be placed in the metadata object of each user which will be stored as part of the user profile.

If present, Moesif will detect special metadata fields like:

If user does not exist, a new one will be created. If a user exists, it will be merged on top of existing fields. Any new field set will override the existing fields. This is done via recursive merge which merges inner objects.

POST https://api.moesif.net/v1/users/batch

Example Request
  [
    {
      "modified_time": "2018-01-20T04:45:42.914",
      "ip_address": "61.48.220.123",
      "session_token": "df32dkj32opxzfdmji4hf4fs98y18cx98q3yhwmnhcfx43f",
      "user_id": "12345",
      "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
      "metadata": {
        "first_name": "John",
        "last_name": "Doe",
        "email": "john@gmail.com",
        "phone": "123-456-7890",
        "custom_string_field": "some_value",
        "custom_int_field": 55,
        "custom_obj_field": {
            "sub_a": "value_a",
            "sub_b": "value_b"
        }
      }
    },
    {
      "modified_time": "2018-01-20T04:45:42.914",
      "ip_address": "61.48.220.129",
      "session_token": "d2ewzcazchurvcqdevnhcuiyrgvru",
      "user_id": "7890",
      "user_agent_string": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",
      "metadata": {
        "first_name": "Mary",
        "last_name": "Doe",
        "email": "mary@gmail.com",
        "phone": "123-456-7890",
        "custom_string_field": "some_value",
        "custom_int_field": 55,
        "custom_obj_field": {
            "sub_a": "value_a",
            "sub_b": "value_b"
        }
      }
    }
  ]

# You can also use wget
curl -X GET https://api.moesif.net/v1/events/batch \
  -H 'Accept: application/json' \
  -H 'X-Moesif-Application-Id: YOUR_COLLECTOR_APPLICATION_ID'


var moesifapi = require('moesifapi');
var api = moesifapi.ApiController;

// 2. Configure the ApplicationId
var config = moesifapi.configuration;
config.ApplicationId = "my_application_id";

// 3. Generate an API Event Model
var userA = {
    userId: "12345",
    sessionToken: "23jdf0owekfmcn4u3qypxg09w4d8ayrcdx8nu2ng]s98y18cx98q3yhwmnhcfx43f",
    metadata: {
      email: "johndoe@acmeinc.com",
      string_field: "value_1",
      number_field: 0,
      object_field: {
        field_a: "value_a",
        field_b: "value_b"
      }
    }
};

var userB = {
    userId: "6789",
    sessionToken: "23jdf0oszfexfqe[lwjfiefovprewv4d8ayrcdx8nu2ng]zfeeadedefx43f",
    metadata: {
      email: "maryjane@acmeinc.com",
      string_field: "value_1",
      number_field: 1,
      object_field: {
        field_a: "value_a",
        field_b: "value_b"
      }
    }
};

var users = [new UserModel(userA), new UserModel(userB)];

// 4. Send batch of events
api.updateUsersBatch(users, function(error, response, context) {
  // Do Something
});
MoesifAPIClient client = new MoesifAPIClient("my_application_id");
APIController api = getClient().getAPI();

List<UserModel> users = new ArrayList<UserModel>();

UserModel userA = new UserBuilder()
    .userId("12345")
    .modifiedTime(new Date())
    .ipAddress("29.80.250.240")
    .sessionToken("di3hd982h3fubv3yfd94egf")
    .userAgentString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36")
    .metadata(APIHelper.deserialize("{" +
        "\"email\": \"johndoe@acmeinc.com\"," +
        "\"string_field\": \"value_1\"," +
        "\"number_field\": 0," +
        "\"object_field\": {" +
          "\"field_1\": \"value_1\"," +
          "\"field_2\": \"value_2\"" +
        "}" +
      "}"))
    .build();
users.add(userA);

UserModel userB = new UserBuilder()
    .userId("56789")
    .modifiedTime(new Date())
    .ipAddress("21.80.11.242")
    .sessionToken("zceadckekvsfgfpsakvnbfouavsdvds")
    .userAgentString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36")
    .metadata(APIHelper.deserialize("{" +
        "\"email\": \"maryjane@acmeinc.com\"," +
        "\"string_field\": \"value_1\"," +
        "\"number_field\": 1," +
        "\"object_field\": {" +
          "\"field_1\": \"value_1\"," +
          "\"field_2\": \"value_2\"" +
        "}" +
      "}"))
    .build();
users.add(userB);

// Asynchronous call to update users
APICallBack<Object> callBack = new APICallBack<Object>() {
    public void onSuccess(HttpContext context, Object response) {
      // Do something
    }

    public void onFailure(HttpContext context, Throwable error) {
      // Do something else
    }
};

api.updateUsersBatchAsync(users, callBack);


//Synchronous call to update users
api.updateUsersBatch(users, callBack);

user_id vs. session_token

Users in Moesif are identified by two attributes: user_id and session_token.

Name Required Description
user_id true Your application’s user_id to identify this user.
modified_time false Last Modified Timestamp for the user in ISO 8601 format (Set automatically if not provided).
ip_address false Current IP address of the user, If not set, we use the IP address of the POST request.
session_token false Current end user session or API token such as a JWT. Setting this field does not remove old session tokens previously stored. Instead, Moesif will append the new value to an alias table for this user_id.
user_agent_string false If you want Moesif to parse a user agent string, you can do so via user_agent_string.
metadata false A JSON Object consisting of any custom metadata to be stored with this user.

Management API v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Management API to query data in Moesif. You can use the management API to export data for custom reports or to build custom dashboards.

Base URL:

Terms of service

Authentication

Authorization: Bearer MY_API_TOKEN

- Token URL = https://api.moesif.com/v1/:orgId/oauth/access_tokens

Scope Scope Description
read:traces Read traces and associated event_ids
update:triage_buckets Update triaged errors such as the status
delete:workspaces Delete existing workspaces for API replay
create:workspaces Create a new workspace for API replay
read:workspaces Read workspaces for API replay
read:events Read/query API calls/events and associated event metadata
create:events Create new API calls/events and associated event metadata
create:users Create new users and associated user metadata
read:metrics Read numeric API metrics such as error count
update:workspaces Update existing workspaces for API replay
read:users Read/query users and associated user metadata
update:users Update existing users and associated user metadata
read:triage_buckets Read triaged errors
delete:users Delete existing users and associated user metadata

Organizations

Gets Organizations

# You can also use wget
curl -X GET https://api.moesif.com/v1/organizations \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/organizations',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/organizations', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/organizations',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /organizations

Gets a list of organization for authenticated user/customer

Example response

[
  {
    "name": "string",
    "service_level": "string",
    "id": "string",
    "created": "2018-05-26T05:35:01Z",
    "apps": [
      {
        "id": "string",
        "name": "string"
      }
    ]
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» name string true No description
» service_level string true No description
» id string false No description
» created string(date-time) true No description
» apps [AppResponse] true No description
»» id string false No description
»» name string true No description

Replay

Delete a HistoryEvent

# You can also use wget
curl -X DELETE https://api.moesif.com/v1/replay/{orgId}/history_events/{id}?app_id=string \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/history_events/{id}?app_id=string',
{
  method: 'DELETE',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.delete('https://api.moesif.com/v1/replay/{orgId}/history_events/{id}', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.delete 'https://api.moesif.com/v1/replay/{orgId}/history_events/{id}',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/history_events/{id}?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


DELETE /replay/{orgId}/history_events/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
id path string true No description

Responses

Status Meaning Description Schema
200 OK success None

Get a Workspace

# You can also use wget
curl -X GET https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /replay/{orgId}/workspaces/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
id path string true No description

Example response

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Delete a Workspace

# You can also use wget
curl -X DELETE https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string',
{
  method: 'DELETE',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.delete('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.delete 'https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


DELETE /replay/{orgId}/workspaces/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
id path string true No description

Responses

Status Meaning Description Schema
200 OK success None

Add a new HistoryEvent

# You can also use wget
curl -X POST https://api.moesif.com/v1/replay/{orgId}/history_events?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/history_events?app_id=string',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/replay/{orgId}/history_events', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/replay/{orgId}/history_events',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/history_events?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /replay/{orgId}/history_events

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
body body See Below false No description

Example response

Responses

Status Meaning Description Schema
201 Created success Inline

Response Schema

Status Code 201

Name Type Required Description

Create New Workspace

# You can also use wget
curl -X POST https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/replay/{orgId}/workspaces', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/replay/{orgId}/workspaces',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /replay/{orgId}/workspaces

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description

Example response

Responses

Status Meaning Description Schema
201 Created success Inline

Response Schema

Status Code 201

Name Type Required Description

Get Workspaces

# You can also use wget
curl -X GET https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/replay/{orgId}/workspaces', params={
  'app_id': 'string',  'take': '0'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/replay/{orgId}/workspaces',
  params: {
  'app_id' => 'string',
'take' => 'integer(int32)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces?app_id=string?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /replay/{orgId}/workspaces

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
take query integer(int32) true No description
before_id query string false No description

Example response

[]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Get HistoryEvents

# You can also use wget
curl -X GET https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/history_events?app_id=string?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/history_events?app_id=string?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/history_events', params={
  'app_id': 'string',  'take': '0'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/history_events',
  params: {
  'app_id' => 'string',
'take' => 'integer(int32)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/history_events?app_id=string?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /replay/{orgId}/workspaces/{id}/history_events

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
id path string true No description
take query integer(int32) true No description
before_id query string false No description

Example response

[]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Update Workspace Sequence

# You can also use wget
curl -X PUT https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/sequence?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/sequence?app_id=string',
{
  method: 'PUT',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.put('https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/sequence', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.put 'https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/sequence',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/replay/{orgId}/workspaces/{id}/sequence?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


PUT /replay/{orgId}/workspaces/{id}/sequence

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
id path string true No description
body body See Below false No description

Example response

[]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Traces

Get Traces

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/traces \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/traces',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/traces', params={
  'session_token': [
  null
],  'triage_bucket.state': [
  null
],  'triage_bucket.route': [
  null
],  'triage_bucket.verb': [
  null
],  'triage_bucket.status': [
  null
],  'triage_bucket.api_version': [
  null
],  'created': [
  null
]
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/traces',
  params: {
  'session_token' => 'array[string]',
'triage_bucket.state' => 'array[int]',
'triage_bucket.route' => 'array[string]',
'triage_bucket.verb' => 'array[string]',
'triage_bucket.status' => 'array[int]',
'triage_bucket.api_version' => 'array[string]',
'created' => 'array[datetime]'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/traces");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/traces

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
user_id query string false No description
take query integer(int32) false No description
before_id query string false No description
after_id query string false No description
session_token query array[fifilterparamsstring] true No description
triage_bucket.state query array[fifilterparamsint] true No description
triage_bucket.route query array[fifilterparamsstring] true No description
triage_bucket.verb query array[fifilterparamsstring] true No description
triage_bucket.status query array[fifilterparamsint] true No description
triage_bucket.api_version query array[fifilterparamsstring] true No description
created query array[fifilterparamsdatetime] true No description
sort query string false No description

Example response

[
  {
    "user_id": "string",
    "triage_bucket": {
      "state": 0,
      "host": "string",
      "session_count": 0,
      "last_modified": "2018-05-26T05:35:01Z",
      "api_version": "string",
      "id": "string",
      "user_count": 0,
      "status": 0,
      "jsonrpc": {
        "method": "string",
        "code": 0
      },
      "verb": "string",
      "metadata": {},
      "event_count": 0,
      "route": "string",
      "graphql": {
        "operation_name": "string",
        "definitions": [
          {
            "operation_type": "string",
            "name": "string"
          }
        ]
      }
    },
    "id": "string",
    "session_token": "string",
    "created": "2018-05-26T05:35:01Z"
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» user_id string false No description
» triage_bucket object false No description
»» state integer(int32) true No description
»» host string true No description
»» session_count integer(int64) false No description
»» last_modified string(date-time) true No description
»» api_version string false No description
»» id string true No description
»» user_count integer(int64) false No description
»» status integer(int32) true No description
»» jsonrpc object false No description
»»» method string false No description
»»» code integer(int32) false No description
»» verb string true No description
»» metadata object false No description
»» event_count integer(int64) false No description
»» route string true No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [SignatureGraphQlDefinition] true No description
»»»» operation_type string false No description
»»»» name string false No description
»»» id string true No description
»»» session_token string false No description
»»» created string(date-time) true No description

Get a trace

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/traces/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/traces/{id}',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/traces/{id}', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/traces/{id}',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/traces/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/traces/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
id path string true No description

Example response

{
  "user_id": "string",
  "triage_bucket": {
    "state": 0,
    "host": "string",
    "session_count": 0,
    "last_modified": "2018-05-26T05:35:01Z",
    "api_version": "string",
    "id": "string",
    "user_count": 0,
    "status": 0,
    "jsonrpc": {
      "method": "string",
      "code": 0
    },
    "verb": "string",
    "metadata": {},
    "event_count": 0,
    "route": "string",
    "graphql": {
      "operation_name": "string",
      "definitions": [
        {
          "operation_type": "string",
          "name": "string"
        }
      ]
    }
  },
  "id": "string",
  "session_token": "string",
  "created": "2018-05-26T05:35:01Z"
}

Responses

Status Meaning Description Schema
200 OK success TraceResponse

Response Schema

Status Code 200

Name Type Required Description
» user_id string false No description
» triage_bucket object false No description
»» state integer(int32) true No description
»» host string true No description
»» session_count integer(int64) false No description
»» last_modified string(date-time) true No description
»» api_version string false No description
»» id string true No description
»» user_count integer(int64) false No description
»» status integer(int32) true No description
»» jsonrpc object false No description
»»» method string false No description
»»» code integer(int32) false No description
»» verb string true No description
»» metadata object false No description
»» event_count integer(int64) false No description
»» route string true No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [SignatureGraphQlDefinition] true No description
»»»» operation_type string false No description
»»»» name string false No description
»»» id string true No description
»»» session_token string false No description
»»» created string(date-time) true No description

Get Events

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/traces/{id}/events?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/traces/{id}/events?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/traces/{id}/events', params={
  'take': '0'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/traces/{id}/events',
  params: {
  'take' => 'integer(int32)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/traces/{id}/events?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/traces/{id}/events

Get a list of events belonging to a single trace

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
id path string true No description
take query integer(int32) true No description
after_id query string false No description
before_id query string false No description

Example response

[
  {
    "request": {
      "body": {},
      "uri": "string",
      "user_agent": {
        "name": "string",
        "os": "string",
        "os_name": "string",
        "major": "string",
        "device": "string",
        "minor": "string"
      },
      "api_version": "string",
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "verb": "string",
      "route": "string",
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string",
      "graphql": {
        "operation_name": "string",
        "definitions": [
          {
            "name": "string",
            "directives": [
              {}
            ],
            "operation_type": "string",
            "selections": [
              {}
            ],
            "variables": [
              {}
            ]
          }
        ],
        "variables": {}
      }
    },
    "trace_id": "string",
    "triage_bucket_id": "string",
    "user_id": "string",
    "response": {
      "body": {},
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "status": 0,
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string"
    },
    "id": "string",
    "session_token": "string",
    "jsonrpc": {
      "request": {
        "jsonrpc": "string",
        "id": "string",
        "method": "string",
        "params": {}
      },
      "response": {
        "jsonrpc": "string",
        "id": "string",
        "error": {}
      }
    },
    "metadata": {},
    "user": {}
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» request object true No description
»» body object false No description
»» uri string true No description
»» user_agent object false No description
»»» name string false No description
»»» os string false No description
»»» os_name string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» api_version string false No description
»» geo_ip object false No description
»»» region_name string false No description
»»» latitude number(double) false No description
»»» timezone string false No description
»»» longitude number(double) false No description
»»» real_region_name string false No description
»»» postal_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_name string false No description
»» ip_address string true No description
»» verb string true No description
»» route string true No description
»» time string(date-time) true No description
»» headers object true No description
»» instance_id string false No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [EventGraphQlDefinition] true No description
»»»» name string false No description
»»»» directives [object] false No description
»»»» operation_type string false No description
»»»» selections [object] false No description
»»»» variables [object] false No description
»»» variables object false No description
»» trace_id string false No description
»» triage_bucket_id string false No description
»» user_id string false No description
»» response object true No description
»»» body object false No description
»»» geo_ip object false No description
»»» ip_address string false No description
»»» status integer(int32) true No description
»»» time string(date-time) true No description
»»» headers object true No description
»»» instance_id string false No description
»» id string true No description
»» session_token string false No description
»» jsonrpc object false No description
»»» request object true No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» method string false No description
»»»» params object false No description
»»» response object false No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» error object false No description
»»» metadata object false No description
»»» user object false No description

Metrics

Get Dashboard Metrics

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/dash/metrics?from=2018-05-26T05:35:01Z \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/dash/metrics?from=2018-05-26T05:35:01Z',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/dash/metrics', params={
  'from': '2018-05-26T05:35:01Z'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/dash/metrics',
  params: {
  'from' => 'string(date-time)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/dash/metrics?from=2018-05-26T05:35:01Z");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/dash/metrics

Gets dashboard overview metrics

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
from query string(date-time) true No description
point_count query integer(int32) false No description
names query array[string] false No description

Example response

{
  "average_duration_ms_ts": null,
  "error_count": 0,
  "error_count_ts": null,
  "user_count_ts": null,
  "user_count": 0,
  "error_user_count": 0,
  "average_duration_ms": 0,
  "error_user_count_ts": null
}

Responses

Status Meaning Description Schema
200 OK success DashMetrics

Response Schema

Status Code 200

Name Type Required Description
» average_duration_ms_ts seq[(datetime, long)] true No description
» error_count integer(int64) true No description
» error_count_ts seq[(datetime, long)] true No description
» user_count_ts seq[(datetime, long)] true No description
» user_count integer(int64) true No description
» error_user_count integer(int64) true No description
» average_duration_ms integer(int64) true No description
» error_user_count_ts seq[(datetime, long)] true No description

OAuth

Get Token Info

# You can also use wget
curl -X GET https://api.moesif.com/v1/~/oauth/tokeninfo?scope=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/~/oauth/tokeninfo?scope=string',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/~/oauth/tokeninfo', params={
  'scope': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/~/oauth/tokeninfo',
  params: {
  'scope' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/~/oauth/tokeninfo?scope=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /~/oauth/tokeninfo

Get info for user’s token

Parameters

Parameter In Type Required Description
scope query string true No description

Example response

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Get a new Access Token

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/oauth/access_tokens?target=string?scope=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/oauth/access_tokens?target=string?scope=string',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/oauth/access_tokens', params={
  'target': 'string',  'scope': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/oauth/access_tokens',
  params: {
  'target' => 'string',
'scope' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/oauth/access_tokens?target=string?scope=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/oauth/access_tokens

Get a new access_token using logged in user’s token

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
target query string true No description
scope query string true No description
expiration query string(date-time) false No description

Example response

{
  "app_token": "string"
}

Responses

Status Meaning Description Schema
200 OK success AccessToken

Response Schema

Status Code 200

Name Type Required Description
» app_token string true No description

URL Encoder

Encodes a URL

# You can also use wget
curl -X POST https://api.moesif.com/v1/url_encoder


const request = require('node-fetch');


fetch('https://api.moesif.com/v1/url_encoder',
{
  method: 'POST'


})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests


r = requests.post('https://api.moesif.com/v1/url_encoder', params={


)


print r.json()


require 'rest-client'
require 'json'


result = RestClient.post 'https://api.moesif.com/v1/url_encoder',
  params: {
  }


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/url_encoder");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /url_encoder

Encodes the URL to be used with Moesif Collector/Proxy Server

Parameters

Parameter In Type Required Description
body body Url false No description

Example request

Request Schema

{
  "url": "string"
}
Name Type Required Description
» url string true No description

Responses

Status Meaning Description Schema
200 OK success None

Triage Buckets

Get Triage Bucket Graph

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/triage_buckets/{id}/graph?depth=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/triage_buckets/{id}/graph?depth=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/triage_buckets/{id}/graph', params={
  'depth': '0',  'error_event.event_id': [
  null
],  'error_event.duration_ms': [
  null
],  'error_event.request.time': [
  null
],  'error_event.request.verb': [
  null
],  'error_event.request.ip_address': [
  null
],  'error_event.request.route': [
  null
],  'error_event.response.ip_address': [
  null
],  'error_event.response.status': [
  null
],  'error_event.session_token': [
  null
],  'error_event.user_id': [
  null
]
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/triage_buckets/{id}/graph',
  params: {
  'depth' => 'integer(int32)',
'error_event.event_id' => 'array[string]',
'error_event.duration_ms' => 'array[int]',
'error_event.request.time' => 'array[datetime]',
'error_event.request.verb' => 'array[string]',
'error_event.request.ip_address' => 'array[string]',
'error_event.request.route' => 'array[string]',
'error_event.response.ip_address' => 'array[string]',
'error_event.response.status' => 'array[int]',
'error_event.session_token' => 'array[string]',
'error_event.user_id' => 'array[string]'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/triage_buckets/{id}/graph?depth=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/triage_buckets/{id}/graph

Get a graph of event signatures by triage bucket id

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description
depth query integer(int32) true No description
error_event.event_id query array[fifilterparamsstring] true No description
error_event.duration_ms query array[fifilterparamsint] true No description
error_event.request.time query array[fifilterparamsdatetime] true No description
error_event.request.verb query array[fifilterparamsstring] true No description
error_event.request.ip_address query array[fifilterparamsstring] true No description
error_event.request.route query array[fifilterparamsstring] true No description
error_event.response.ip_address query array[fifilterparamsstring] true No description
error_event.response.status query array[fifilterparamsint] true No description
error_event.session_token query array[fifilterparamsstring] true No description
error_event.user_id query array[fifilterparamsstring] true No description

Example response

{
  "triage_bucket_id": "string",
  "error_signature_id": "string",
  "edges": [
    {
      "from_vertex": {
        "signature_id": "string",
        "host": "string",
        "session_count": 0,
        "response": {
          "status_code": 0
        },
        "user_count": 0,
        "jsonrpc": {
          "method": "string",
          "code": 0
        },
        "verb": "string",
        "event_count": 0,
        "route": "string",
        "created": "2018-05-26T05:35:01Z",
        "graphql": {
          "operation_name": "string",
          "definitions": [
            {
              "operation_type": "string",
              "name": "string"
            }
          ]
        }
      },
      "to_vertex": {
        "signature_id": "string",
        "host": "string",
        "session_count": 0,
        "response": {
          "status_code": 0
        },
        "user_count": 0,
        "jsonrpc": {
          "method": "string",
          "code": 0
        },
        "verb": "string",
        "event_count": 0,
        "route": "string",
        "created": "2018-05-26T05:35:01Z",
        "graphql": {
          "operation_name": "string",
          "definitions": [
            {
              "operation_type": "string",
              "name": "string"
            }
          ]
        }
      },
      "value": 0
    }
  ],
  "triage_bucket": {
    "state": 0,
    "host": "string",
    "session_count": 0,
    "last_modified": "2018-05-26T05:35:01Z",
    "api_version": "string",
    "id": "string",
    "user_count": 0,
    "status": 0,
    "jsonrpc": {
      "method": "string",
      "code": 0
    },
    "verb": "string",
    "metadata": {},
    "event_count": 0,
    "route": "string",
    "graphql": {
      "operation_name": "string",
      "definitions": [
        {
          "operation_type": "string",
          "name": "string"
        }
      ]
    }
  }
}

Responses

Status Meaning Description Schema
200 OK success SignatureGraphResponse

Response Schema

Status Code 200

Name Type Required Description
» triage_bucket_id string true No description
» error_signature_id string true No description
» edges [SignatureEdge] false No description
»» from_vertex object true No description
»»» signature_id string true No description
»»» host string false No description
»»» session_count integer(int64) false No description
»»» response object false No description
»»»» status_code integer(int32) true No description
»»» user_count integer(int64) false No description
»»» jsonrpc object false No description
»»»» method string false No description
»»»» code integer(int32) false No description
»»» verb string true No description
»»» event_count integer(int64) false No description
»»» route string true No description
»»» created string(date-time) true No description
»»» graphql object false No description
»»»» operation_name string false No description
»»»» definitions [SignatureGraphQlDefinition] true No description
»»»»» operation_type string false No description
»»»»» name string false No description
»»»» to_vertex object true No description
»»»» value number(double) true No description
»»» triage_bucket object false No description
»»»» state integer(int32) true No description
»»»» host string true No description
»»»» session_count integer(int64) false No description
»»»» last_modified string(date-time) true No description
»»»» api_version string false No description
»»»» id string true No description
»»»» user_count integer(int64) false No description
»»»» status integer(int32) true No description
»»»» jsonrpc object false No description
»»»» verb string true No description
»»»» metadata object false No description
»»»» event_count integer(int64) false No description
»»»» route string true No description
»»»» graphql object false No description

Gets Triage Buckets

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/triage_buckets?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/triage_buckets?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/triage_buckets', params={
  'take': '0',  'state': [
  null
],  'last_modified': [
  null
],  'route': [
  null
],  'verb': [
  null
],  'status': [
  null
],  'api_version': [
  null
]
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/triage_buckets',
  params: {
  'take' => 'integer(int32)',
'state' => 'array[int]',
'last_modified' => 'array[datetime]',
'route' => 'array[string]',
'verb' => 'array[string]',
'status' => 'array[int]',
'api_version' => 'array[string]'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/triage_buckets?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/triage_buckets

Gets a list of triage buckets for authenticated in user under the given organization

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
take query integer(int32) true No description
before_id query string false No description
after_id query string false No description
state query array[fifilterparamsint] true No description
last_modified query array[fifilterparamsdatetime] true No description
route query array[fifilterparamsstring] true No description
verb query array[fifilterparamsstring] true No description
status query array[fifilterparamsint] true No description
api_version query array[fifilterparamsstring] true No description
sort query string false No description

Example response

[
  {
    "state": 0,
    "host": "string",
    "session_count": 0,
    "last_modified": "2018-05-26T05:35:01Z",
    "api_version": "string",
    "id": "string",
    "user_count": 0,
    "status": 0,
    "jsonrpc": {
      "method": "string",
      "code": 0
    },
    "verb": "string",
    "metadata": {},
    "event_count": 0,
    "route": "string",
    "graphql": {
      "operation_name": "string",
      "definitions": [
        {
          "operation_type": "string",
          "name": "string"
        }
      ]
    }
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» state integer(int32) true No description
» host string true No description
» session_count integer(int64) false No description
» last_modified string(date-time) true No description
» api_version string false No description
» id string true No description
» user_count integer(int64) false No description
» status integer(int32) true No description
» jsonrpc object false No description
»» method string false No description
»» code integer(int32) false No description
» verb string true No description
» metadata object false No description
» event_count integer(int64) false No description
» route string true No description
» graphql object false No description
»» operation_name string false No description
»» definitions [SignatureGraphQlDefinition] true No description
»»» operation_type string false No description
»»» name string false No description

Updates a Triage Bucket

# You can also use wget
curl -X POST https://api.moesif.com/v1/{orgId}/triage_buckets/{triageBucketId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/triage_buckets/{triageBucketId}',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/{orgId}/triage_buckets/{triageBucketId}', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/{orgId}/triage_buckets/{triageBucketId}',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/triage_buckets/{triageBucketId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /{orgId}/triage_buckets/{triageBucketId}

Updates a Triage Bucket (Null fields ignored)

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
triageBucketId path string true No description
body body TriageBucketUpdate false No description

Example response

{
  "state": 0,
  "host": "string",
  "session_count": 0,
  "last_modified": "2018-05-26T05:35:01Z",
  "api_version": "string",
  "id": "string",
  "user_count": 0,
  "status": 0,
  "jsonrpc": {
    "method": "string",
    "code": 0
  },
  "verb": "string",
  "metadata": {},
  "event_count": 0,
  "route": "string",
  "graphql": {
    "operation_name": "string",
    "definitions": [
      {
        "operation_type": "string",
        "name": "string"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK success TriageBucketResponse

Response Schema

Status Code 200

Name Type Required Description
» state integer(int32) true No description
» host string true No description
» session_count integer(int64) false No description
» last_modified string(date-time) true No description
» api_version string false No description
» id string true No description
» user_count integer(int64) false No description
» status integer(int32) true No description
» jsonrpc object false No description
»» method string false No description
»» code integer(int32) false No description
» verb string true No description
» metadata object false No description
» event_count integer(int64) false No description
» route string true No description
» graphql object false No description
»» operation_name string false No description
»» definitions [SignatureGraphQlDefinition] true No description
»»» operation_type string false No description
»»» name string false No description

Signatures

Get Events

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/signatures/{id}/events?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/signatures/{id}/events?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/signatures/{id}/events', params={
  'take': '0',  'event_id': [
  null
],  'duration_ms': [
  null
],  'request.time': [
  null
],  'request.verb': [
  null
],  'request.ip_address': [
  null
],  'request.route': [
  null
],  'response.ip_address': [
  null
],  'response.status': [
  null
],  'session_token': [
  null
],  'user_id': [
  null
]
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/signatures/{id}/events',
  params: {
  'take' => 'integer(int32)',
'event_id' => 'array[string]',
'duration_ms' => 'array[int]',
'request.time' => 'array[datetime]',
'request.verb' => 'array[string]',
'request.ip_address' => 'array[string]',
'request.route' => 'array[string]',
'response.ip_address' => 'array[string]',
'response.status' => 'array[int]',
'session_token' => 'array[string]',
'user_id' => 'array[string]'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/signatures/{id}/events?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/signatures/{id}/events

Get a list of events that matched a particular signature

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description
take query integer(int32) true No description
after_id query string false No description
before_id query string false No description
event_id query array[fifilterparamsstring] true No description
duration_ms query array[fifilterparamsint] true No description
request.time query array[fifilterparamsdatetime] true No description
request.verb query array[fifilterparamsstring] true No description
request.ip_address query array[fifilterparamsstring] true No description
request.route query array[fifilterparamsstring] true No description
response.ip_address query array[fifilterparamsstring] true No description
response.status query array[fifilterparamsint] true No description
session_token query array[fifilterparamsstring] true No description
user_id query array[fifilterparamsstring] true No description

Example response

[
  {
    "request": {
      "body": {},
      "uri": "string",
      "user_agent": {
        "name": "string",
        "os": "string",
        "os_name": "string",
        "major": "string",
        "device": "string",
        "minor": "string"
      },
      "api_version": "string",
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "verb": "string",
      "route": "string",
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string",
      "graphql": {
        "operation_name": "string",
        "definitions": [
          {
            "name": "string",
            "directives": [
              {}
            ],
            "operation_type": "string",
            "selections": [
              {}
            ],
            "variables": [
              {}
            ]
          }
        ],
        "variables": {}
      }
    },
    "trace_id": "string",
    "triage_bucket_id": "string",
    "user_id": "string",
    "response": {
      "body": {},
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "status": 0,
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string"
    },
    "id": "string",
    "session_token": "string",
    "jsonrpc": {
      "request": {
        "jsonrpc": "string",
        "id": "string",
        "method": "string",
        "params": {}
      },
      "response": {
        "jsonrpc": "string",
        "id": "string",
        "error": {}
      }
    },
    "metadata": {},
    "user": {}
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» request object true No description
»» body object false No description
»» uri string true No description
»» user_agent object false No description
»»» name string false No description
»»» os string false No description
»»» os_name string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» api_version string false No description
»» geo_ip object false No description
»»» region_name string false No description
»»» latitude number(double) false No description
»»» timezone string false No description
»»» longitude number(double) false No description
»»» real_region_name string false No description
»»» postal_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_name string false No description
»» ip_address string true No description
»» verb string true No description
»» route string true No description
»» time string(date-time) true No description
»» headers object true No description
»» instance_id string false No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [EventGraphQlDefinition] true No description
»»»» name string false No description
»»»» directives [object] false No description
»»»» operation_type string false No description
»»»» selections [object] false No description
»»»» variables [object] false No description
»»» variables object false No description
»» trace_id string false No description
»» triage_bucket_id string false No description
»» user_id string false No description
»» response object true No description
»»» body object false No description
»»» geo_ip object false No description
»»» ip_address string false No description
»»» status integer(int32) true No description
»»» time string(date-time) true No description
»»» headers object true No description
»»» instance_id string false No description
»» id string true No description
»» session_token string false No description
»» jsonrpc object false No description
»»» request object true No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» method string false No description
»»»» params object false No description
»»» response object false No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» error object false No description
»»» metadata object false No description
»»» user object false No description

Get Aggregations

# You can also use wget
curl -X POST https://api.moesif.com/v1/{orgId}/signatures/{id}/aggs \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/signatures/{id}/aggs',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/{orgId}/signatures/{id}/aggs', params={
  'event_id': [
  null
],  'duration_ms': [
  null
],  'request.time': [
  null
],  'request.verb': [
  null
],  'request.ip_address': [
  null
],  'request.route': [
  null
],  'response.ip_address': [
  null
],  'response.status': [
  null
],  'session_token': [
  null
],  'user_id': [
  null
]
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/{orgId}/signatures/{id}/aggs',
  params: {
  'event_id' => 'array[string]',
'duration_ms' => 'array[int]',
'request.time' => 'array[datetime]',
'request.verb' => 'array[string]',
'request.ip_address' => 'array[string]',
'request.route' => 'array[string]',
'response.ip_address' => 'array[string]',
'response.status' => 'array[int]',
'session_token' => 'array[string]',
'user_id' => 'array[string]'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/signatures/{id}/aggs");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /{orgId}/signatures/{id}/aggs

Get an aggregation of a fields for a particular signature

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description
after_id query string false No description
before_id query string false No description
event_id query array[fifilterparamsstring] true No description
duration_ms query array[fifilterparamsint] true No description
request.time query array[fifilterparamsdatetime] true No description
request.verb query array[fifilterparamsstring] true No description
request.ip_address query array[fifilterparamsstring] true No description
request.route query array[fifilterparamsstring] true No description
response.ip_address query array[fifilterparamsstring] true No description
response.status query array[fifilterparamsint] true No description
session_token query array[fifilterparamsstring] true No description
user_id query array[fifilterparamsstring] true No description

Example response

[
  {
    "request": {
      "body": {},
      "uri": "string",
      "user_agent": {
        "name": "string",
        "os": "string",
        "os_name": "string",
        "major": "string",
        "device": "string",
        "minor": "string"
      },
      "api_version": "string",
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "verb": "string",
      "route": "string",
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string",
      "graphql": {
        "operation_name": "string",
        "definitions": [
          {
            "name": "string",
            "directives": [
              {}
            ],
            "operation_type": "string",
            "selections": [
              {}
            ],
            "variables": [
              {}
            ]
          }
        ],
        "variables": {}
      }
    },
    "trace_id": "string",
    "triage_bucket_id": "string",
    "user_id": "string",
    "response": {
      "body": {},
      "geo_ip": {
        "region_name": "string",
        "latitude": 0,
        "timezone": "string",
        "longitude": 0,
        "real_region_name": "string",
        "postal_code": "string",
        "city_name": "string",
        "country_code2": "string",
        "country_name": "string"
      },
      "ip_address": "string",
      "status": 0,
      "time": "2018-05-26T05:35:01Z",
      "headers": {},
      "instance_id": "string"
    },
    "id": "string",
    "session_token": "string",
    "jsonrpc": {
      "request": {
        "jsonrpc": "string",
        "id": "string",
        "method": "string",
        "params": {}
      },
      "response": {
        "jsonrpc": "string",
        "id": "string",
        "error": {}
      }
    },
    "metadata": {},
    "user": {}
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» request object true No description
»» body object false No description
»» uri string true No description
»» user_agent object false No description
»»» name string false No description
»»» os string false No description
»»» os_name string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» api_version string false No description
»» geo_ip object false No description
»»» region_name string false No description
»»» latitude number(double) false No description
»»» timezone string false No description
»»» longitude number(double) false No description
»»» real_region_name string false No description
»»» postal_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_name string false No description
»» ip_address string true No description
»» verb string true No description
»» route string true No description
»» time string(date-time) true No description
»» headers object true No description
»» instance_id string false No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [EventGraphQlDefinition] true No description
»»»» name string false No description
»»»» directives [object] false No description
»»»» operation_type string false No description
»»»» selections [object] false No description
»»»» variables [object] false No description
»»» variables object false No description
»» trace_id string false No description
»» triage_bucket_id string false No description
»» user_id string false No description
»» response object true No description
»»» body object false No description
»»» geo_ip object false No description
»»» ip_address string false No description
»»» status integer(int32) true No description
»»» time string(date-time) true No description
»»» headers object true No description
»»» instance_id string false No description
»» id string true No description
»» session_token string false No description
»» jsonrpc object false No description
»»» request object true No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» method string false No description
»»»» params object false No description
»»» response object false No description
»»»» jsonrpc string true No description
»»»» id string false No description
»»»» error object false No description
»»» metadata object false No description
»»» user object false No description

Get Traces

# You can also use wget
curl -X GET https://api.moesif.com/v1/{orgId}/signatures/{id}/traces?take=0 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/{orgId}/signatures/{id}/traces?take=0',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/{orgId}/signatures/{id}/traces', params={
  'take': '0'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/{orgId}/signatures/{id}/traces',
  params: {
  'take' => 'integer(int32)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/{orgId}/signatures/{id}/traces?take=0");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /{orgId}/signatures/{id}/traces

Get a list of traces that matched a particular signature

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description
take query integer(int32) true No description
after_id query string false No description
before_id query string false No description

Example response

[
  {
    "user_id": "string",
    "triage_bucket": {
      "state": 0,
      "host": "string",
      "session_count": 0,
      "last_modified": "2018-05-26T05:35:01Z",
      "api_version": "string",
      "id": "string",
      "user_count": 0,
      "status": 0,
      "jsonrpc": {
        "method": "string",
        "code": 0
      },
      "verb": "string",
      "metadata": {},
      "event_count": 0,
      "route": "string",
      "graphql": {
        "operation_name": "string",
        "definitions": [
          {
            "operation_type": "string",
            "name": "string"
          }
        ]
      }
    },
    "id": "string",
    "session_token": "string",
    "created": "2018-05-26T05:35:01Z"
  }
]

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description
» user_id string false No description
» triage_bucket object false No description
»» state integer(int32) true No description
»» host string true No description
»» session_count integer(int64) false No description
»» last_modified string(date-time) true No description
»» api_version string false No description
»» id string true No description
»» user_count integer(int64) false No description
»» status integer(int32) true No description
»» jsonrpc object false No description
»»» method string false No description
»»» code integer(int32) false No description
»» verb string true No description
»» metadata object false No description
»» event_count integer(int64) false No description
»» route string true No description
»» graphql object false No description
»»» operation_name string false No description
»»» definitions [SignatureGraphQlDefinition] true No description
»»»» operation_type string false No description
»»»» name string false No description
»»» id string true No description
»»» session_token string false No description
»»» created string(date-time) true No description

Health

Health Probe

# You can also use wget
curl -X GET https://api.moesif.com/v1/health/probe \
  -H 'Accept: application/json'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json'


};


fetch('https://api.moesif.com/v1/health/probe',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json'
}


r = requests.get('https://api.moesif.com/v1/health/probe', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json'
}


result = RestClient.get 'https://api.moesif.com/v1/health/probe',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/health/probe");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /health/probe

Example response

{
  "status": true,
  "region": "string"
}

Responses

Status Meaning Description Schema
200 OK success Status

Response Schema

Status Code 200

Name Type Required Description
» status boolean true No description
» region string true No description

Issue Tracking

Get a Jira Accunt

# You can also use wget
curl -X GET https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /issue_tracking/{orgId}/jira/account

Get the linked Jira Account

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description

Example response

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Update a Jira Account

# You can also use wget
curl -X POST https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /issue_tracking/{orgId}/jira/account

Create or update a linked Jira Account

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description
body body JiraAccountUpdate false No description

Example response

Responses

Status Meaning Description Schema
201 Created success Inline

Response Schema

Status Code 201

Name Type Required Description

Delete a Jira Account

# You can also use wget
curl -X DELETE https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string',
{
  method: 'DELETE',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.delete('https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account', params={
  'app_id': 'string'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.delete 'https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account',
  params: {
  'app_id' => 'string'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/issue_tracking/{orgId}/jira/account?app_id=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


DELETE /issue_tracking/{orgId}/jira/account

Delete the linked Jira Account

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string true No description

Responses

Status Meaning Description Schema
200 OK success None

Mappings

Get Mapping for Users

# You can also use wget
curl -X GET https://api.moesif.com/v1/search/{orgId}/mappings/users/properties \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/mappings/users/properties',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/search/{orgId}/mappings/users/properties', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/search/{orgId}/mappings/users/properties',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/mappings/users/properties");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /search/{orgId}/mappings/users/properties

Parameters

Parameter In Type Required Description
orgId path string true No description

Example response

Responses

Status Meaning Description Schema
200 OK success Inline

Response Schema

Status Code 200

Name Type Required Description

Events

Search Events

# You can also use wget
curl -X POST https://api.moesif.com/v1/search/{orgId}/search/events?from=2018-05-26T05:35:01Z?to=2018-05-26T05:35:01Z \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/search/events?from=2018-05-26T05:35:01Z?to=2018-05-26T05:35:01Z',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/search/{orgId}/search/events', params={
  'from': '2018-05-26T05:35:01Z',  'to': '2018-05-26T05:35:01Z'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/search/{orgId}/search/events',
  params: {
  'from' => 'string(date-time)',
'to' => 'string(date-time)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/search/events?from=2018-05-26T05:35:01Z?to=2018-05-26T05:35:01Z");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /search/{orgId}/search/events

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
from query string(date-time) true No description
to query string(date-time) true No description
body body See Below false The search definition using the Elasticsearch Query DSL

Example response

{
  "took": 0,
  "timed_out": false,
  "hits": {
    "total": 0,
    "hits": [
      {
        "_id": "",
        "_source": {
          "duration_ms": 0,
          "request": {
            "body": {},
            "uri": "",
            "user_agent": {
              "patch": "",
              "major": "",
              "minor": "",
              "name": ""
            },
            "geo_ip": {
              "ip": "",
              "region_name": "",
              "continent_code": "",
              "location": [
                0
              ],
              "latitude": 0,
              "timezone": "",
              "area_code": 0,
              "longitude": 0,
              "real_region_name": "",
              "dma_code": 0,
              "postal_code": "",
              "city_name": "",
              "country_code2": "",
              "country_code3": "",
              "country_name": ""
            },
            "ip_address": "",
            "verb": "",
            "route": "",
            "time": "",
            "headers": {
              "_accept-_encoding": "",
              "_connection": "",
              "_cache-_control": "",
              "_user-_agent": "",
              "_host": "",
              "_accept": ""
            }
          },
          "user_id": "",
          "response": {
            "headers": {
              "_date": "",
              "_vary": "",
              "_cache-_control": "",
              "_strict-_transport-_security": "",
              "_access-_control-_expose-_headers": "",
              "_content-_security-_policy": "",
              "_transfer-_encoding": "",
              "_e_tag": "",
              "_content-_type": "",
              "_access-_control-_allow-_origin": ""
            },
            "time": "",
            "body": {},
            "status": 0
          },
          "id": "",
          "session_token": "",
          "metadata": {},
          "app_id": "",
          "org_id": "",
          "user": {}
        },
        "sort": [
          0
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
201 Created success searchEventsResponse

Response Schema

Status Code 201

Name Type Required Description
» took integer false No description
» timed_out boolean false No description
» hits object false No description
»» total integer false No description
»» hits [eventResponse] false No description
»»» _id string false No description
»»» _source object false No description
»»»» duration_ms integer false No description
»»»» request object false No description
»»»»» body object false No description
»»»»» uri string false No description
»»»»» user_agent object false No description
»»»»»» patch string false No description
»»»»»» major string false No description
»»»»»» minor string false No description
»»»»»» name string false No description
»»»»» geo_ip object false No description
»»»»»» ip string false No description
»»»»»» region_name string false No description
»»»»»» continent_code string false No description
»»»»»» location [double] false No description
»»»»»» latitude double false No description
»»»»»» timezone string false No description
»»»»»» area_code integer false No description
»»»»»» longitude double false No description
»»»»»» real_region_name string false No description
»»»»»» dma_code integer false No description
»»»»»» postal_code string false No description
»»»»»» city_name string false No description
»»»»»» country_code2 string false No description
»»»»»» country_code3 string false No description
»»»»»» country_name string false No description
»»»»» ip_address string false No description
»»»»» verb string false No description
»»»»» route string false No description
»»»»» time string false No description
»»»»» headers object false No description
»»»»»» _accept-_encoding string false No description
»»»»»» _connection string false No description
»»»»»» _cache-_control string false No description
»»»»»» _user-_agent string false No description
»»»»»» _host string false No description
»»»»»» _accept string false No description
»»»»» user_id string false No description
»»»»» response object false No description
»»»»»» headers object false No description
»»»»»»» _date string false No description
»»»»»»» _vary string false No description
»»»»»»» _cache-_control string false No description
»»»»»»» _strict-_transport-_security string false No description
»»»»»»» _access-_control-_expose-_headers string false No description
»»»»»»» _content-_security-_policy string false No description
»»»»»»» _transfer-_encoding string false No description
»»»»»»» _e_tag string false No description
»»»»»»» _content-_type string false No description
»»»»»»» _access-_control-_allow-_origin string false No description
»»»»»» time string false No description
»»»»»» body object false No description
»»»»»» status integer false No description
»»»»» id string false No description
»»»»» session_token string false No description
»»»»» metadata object false No description
»»»»» app_id string false No description
»»»»» org_id string false No description
»»»»» user object false No description
»»»» sort [integer] false No description

Get an Event

# You can also use wget
curl -X GET https://api.moesif.com/v1/search/{orgId}/events/{id}?event_time=2018-05-26T05:35:01Z \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/events/{id}?event_time=2018-05-26T05:35:01Z',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/search/{orgId}/events/{id}', params={
  'event_time': '2018-05-26T05:35:01Z'
}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/search/{orgId}/events/{id}',
  params: {
  'event_time' => 'string(date-time)'
}, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/events/{id}?event_time=2018-05-26T05:35:01Z");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /search/{orgId}/events/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description
event_time query string(date-time) true No description

Example response

{
  "_id": "",
  "_source": {
    "duration_ms": 0,
    "request": {
      "body": {},
      "uri": "",
      "user_agent": {
        "patch": "",
        "major": "",
        "minor": "",
        "name": ""
      },
      "geo_ip": {
        "ip": "",
        "region_name": "",
        "continent_code": "",
        "location": [
          0
        ],
        "latitude": 0,
        "timezone": "",
        "area_code": 0,
        "longitude": 0,
        "real_region_name": "",
        "dma_code": 0,
        "postal_code": "",
        "city_name": "",
        "country_code2": "",
        "country_code3": "",
        "country_name": ""
      },
      "ip_address": "",
      "verb": "",
      "route": "",
      "time": "",
      "headers": {
        "_accept-_encoding": "",
        "_connection": "",
        "_cache-_control": "",
        "_user-_agent": "",
        "_host": "",
        "_accept": ""
      }
    },
    "user_id": "",
    "response": {
      "headers": {
        "_date": "",
        "_vary": "",
        "_cache-_control": "",
        "_strict-_transport-_security": "",
        "_access-_control-_expose-_headers": "",
        "_content-_security-_policy": "",
        "_transfer-_encoding": "",
        "_e_tag": "",
        "_content-_type": "",
        "_access-_control-_allow-_origin": ""
      },
      "time": "",
      "body": {},
      "status": 0
    },
    "id": "",
    "session_token": "",
    "metadata": {},
    "app_id": "",
    "org_id": "",
    "user": {}
  },
  "sort": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK success eventResponse

Response Schema

Status Code 200

Name Type Required Description
» _id string false No description
» _source object false No description
»» duration_ms integer false No description
»» request object false No description
»»» body object false No description
»»» uri string false No description
»»» user_agent object false No description
»»»» patch string false No description
»»»» major string false No description
»»»» minor string false No description
»»»» name string false No description
»»» geo_ip object false No description
»»»» ip string false No description
»»»» region_name string false No description
»»»» continent_code string false No description
»»»» location [double] false No description
»»»» latitude double false No description
»»»» timezone string false No description
»»»» area_code integer false No description
»»»» longitude double false No description
»»»» real_region_name string false No description
»»»» dma_code integer false No description
»»»» postal_code string false No description
»»»» city_name string false No description
»»»» country_code2 string false No description
»»»» country_code3 string false No description
»»»» country_name string false No description
»»» ip_address string false No description
»»» verb string false No description
»»» route string false No description
»»» time string false No description
»»» headers object false No description
»»»» _accept-_encoding string false No description
»»»» _connection string false No description
»»»» _cache-_control string false No description
»»»» _user-_agent string false No description
»»»» _host string false No description
»»»» _accept string false No description
»»» user_id string false No description
»»» response object false No description
»»»» headers object false No description
»»»»» _date string false No description
»»»»» _vary string false No description
»»»»» _cache-_control string false No description
»»»»» _strict-_transport-_security string false No description
»»»»» _access-_control-_expose-_headers string false No description
»»»»» _content-_security-_policy string false No description
»»»»» _transfer-_encoding string false No description
»»»»» _e_tag string false No description
»»»»» _content-_type string false No description
»»»»» _access-_control-_allow-_origin string false No description
»»»» time string false No description
»»»» body object false No description
»»»» status integer false No description
»»» id string false No description
»»» session_token string false No description
»»» metadata object false No description
»»» app_id string false No description
»»» org_id string false No description
»»» user object false No description
»» sort [integer] false No description

Users

Update a User

# You can also use wget
curl -X POST https://api.moesif.com/v1/search/{orgId}/users \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/users',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/search/{orgId}/users', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/search/{orgId}/users',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /search/{orgId}/users

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
body body UserUpdate false No description

Example response

{
  "_id": "",
  "_source": {
    "first_name": "",
    "body": {},
    "name": "",
    "email": "",
    "first_seen_time": "",
    "user_agent": {
      "name": "",
      "os_major": "",
      "os": "",
      "os_name": "",
      "os_minor": "",
      "major": "",
      "device": "",
      "minor": ""
    },
    "geo_ip": {
      "ip": "",
      "region_name": "",
      "continent_code": "",
      "location": {
        "lon": 0,
        "lat": 0
      },
      "latitude": 0,
      "timezone": "",
      "longitude": 0,
      "dma_code": 0,
      "postal_code": "",
      "region_code": "",
      "city_name": "",
      "country_code2": "",
      "country_code3": "",
      "country_name": ""
    },
    "modified_time": "",
    "last_name": "",
    "ip_address": "",
    "session_token": [
      ""
    ],
    "last_seen_time": "",
    "app_id": "",
    "org_id": ""
  },
  "sort": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK success userResponse

Response Schema

Status Code 200

Name Type Required Description
» _id string false No description
» _source object false No description
»» first_name string false No description
»» body object false No description
»» name string false No description
»» email string false No description
»» first_seen_time string false No description
»» user_agent object false No description
»»» name string false No description
»»» os_major string false No description
»»» os string false No description
»»» os_name string false No description
»»» os_minor string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» geo_ip object false No description
»»» ip string false No description
»»» region_name string false No description
»»» continent_code string false No description
»»» location object false No description
»»»» lon double false No description
»»»» lat double false No description
»»» latitude double false No description
»»» timezone string false No description
»»» longitude double false No description
»»» dma_code integer false No description
»»» postal_code string false No description
»»» region_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_code3 string false No description
»»» country_name string false No description
»» modified_time string false No description
»» last_name string false No description
»» ip_address string false No description
»» session_token [string] false No description
»» last_seen_time string false No description
»» app_id string false No description
»» org_id string false No description
» sort [integer] false No description

Search Users

# You can also use wget
curl -X POST https://api.moesif.com/v1/search/{orgId}/search/users \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/search/users',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/search/{orgId}/search/users', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/search/{orgId}/search/users',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/search/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /search/{orgId}/search/users

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
body body See Below false The search definition using the Elasticsearch Query DSL

Example response

{
  "took": 0,
  "timed_out": false,
  "hits": {
    "total": 0,
    "hits": [
      {
        "_id": "",
        "_source": {
          "first_name": "",
          "body": {},
          "name": "",
          "email": "",
          "first_seen_time": "",
          "user_agent": {
            "name": "",
            "os_major": "",
            "os": "",
            "os_name": "",
            "os_minor": "",
            "major": "",
            "device": "",
            "minor": ""
          },
          "geo_ip": {
            "ip": "",
            "region_name": "",
            "continent_code": "",
            "location": {
              "lon": 0,
              "lat": 0
            },
            "latitude": 0,
            "timezone": "",
            "longitude": 0,
            "dma_code": 0,
            "postal_code": "",
            "region_code": "",
            "city_name": "",
            "country_code2": "",
            "country_code3": "",
            "country_name": ""
          },
          "modified_time": "",
          "last_name": "",
          "ip_address": "",
          "session_token": [
            ""
          ],
          "last_seen_time": "",
          "app_id": "",
          "org_id": ""
        },
        "sort": [
          0
        ]
      }
    ]
  }
}

Responses

Status Meaning Description Schema
201 Created success searchUsersResponse

Response Schema

Status Code 201

Name Type Required Description
» took integer false No description
» timed_out boolean false No description
» hits object false No description
»» total integer false No description
»» hits [userResponse] false No description
»»» _id string false No description
»»» _source object false No description
»»»» first_name string false No description
»»»» body object false No description
»»»» name string false No description
»»»» email string false No description
»»»» first_seen_time string false No description
»»»» user_agent object false No description
»»»»» name string false No description
»»»»» os_major string false No description
»»»»» os string false No description
»»»»» os_name string false No description
»»»»» os_minor string false No description
»»»»» major string false No description
»»»»» device string false No description
»»»»» minor string false No description
»»»» geo_ip object false No description
»»»»» ip string false No description
»»»»» region_name string false No description
»»»»» continent_code string false No description
»»»»» location object false No description
»»»»»» lon double false No description
»»»»»» lat double false No description
»»»»» latitude double false No description
»»»»» timezone string false No description
»»»»» longitude double false No description
»»»»» dma_code integer false No description
»»»»» postal_code string false No description
»»»»» region_code string false No description
»»»»» city_name string false No description
»»»»» country_code2 string false No description
»»»»» country_code3 string false No description
»»»»» country_name string false No description
»»»» modified_time string false No description
»»»» last_name string false No description
»»»» ip_address string false No description
»»»» session_token [string] false No description
»»»» last_seen_time string false No description
»»»» app_id string false No description
»»»» org_id string false No description
»»» sort [integer] false No description

Update Users in Batch

# You can also use wget
curl -X POST https://api.moesif.com/v1/search/{orgId}/users/batch \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/users/batch',
{
  method: 'POST',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.post('https://api.moesif.com/v1/search/{orgId}/users/batch', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.post 'https://api.moesif.com/v1/search/{orgId}/users/batch',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/users/batch");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


POST /search/{orgId}/users/batch

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
body body array[object] false No description

Example response

{
  "_id": "",
  "_source": {
    "first_name": "",
    "body": {},
    "name": "",
    "email": "",
    "first_seen_time": "",
    "user_agent": {
      "name": "",
      "os_major": "",
      "os": "",
      "os_name": "",
      "os_minor": "",
      "major": "",
      "device": "",
      "minor": ""
    },
    "geo_ip": {
      "ip": "",
      "region_name": "",
      "continent_code": "",
      "location": {
        "lon": 0,
        "lat": 0
      },
      "latitude": 0,
      "timezone": "",
      "longitude": 0,
      "dma_code": 0,
      "postal_code": "",
      "region_code": "",
      "city_name": "",
      "country_code2": "",
      "country_code3": "",
      "country_name": ""
    },
    "modified_time": "",
    "last_name": "",
    "ip_address": "",
    "session_token": [
      ""
    ],
    "last_seen_time": "",
    "app_id": "",
    "org_id": ""
  },
  "sort": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK success userResponse

Response Schema

Status Code 200

Name Type Required Description
» _id string false No description
» _source object false No description
»» first_name string false No description
»» body object false No description
»» name string false No description
»» email string false No description
»» first_seen_time string false No description
»» user_agent object false No description
»»» name string false No description
»»» os_major string false No description
»»» os string false No description
»»» os_name string false No description
»»» os_minor string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» geo_ip object false No description
»»» ip string false No description
»»» region_name string false No description
»»» continent_code string false No description
»»» location object false No description
»»»» lon double false No description
»»»» lat double false No description
»»» latitude double false No description
»»» timezone string false No description
»»» longitude double false No description
»»» dma_code integer false No description
»»» postal_code string false No description
»»» region_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_code3 string false No description
»»» country_name string false No description
»» modified_time string false No description
»» last_name string false No description
»» ip_address string false No description
»» session_token [string] false No description
»» last_seen_time string false No description
»» app_id string false No description
»» org_id string false No description
» sort [integer] false No description

Get a User

# You can also use wget
curl -X GET https://api.moesif.com/v1/search/{orgId}/users/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/users/{id}',
{
  method: 'GET',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.get('https://api.moesif.com/v1/search/{orgId}/users/{id}', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.get 'https://api.moesif.com/v1/search/{orgId}/users/{id}',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/users/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


GET /search/{orgId}/users/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
id path string true No description

Example response

{
  "_id": "",
  "_source": {
    "first_name": "",
    "body": {},
    "name": "",
    "email": "",
    "first_seen_time": "",
    "user_agent": {
      "name": "",
      "os_major": "",
      "os": "",
      "os_name": "",
      "os_minor": "",
      "major": "",
      "device": "",
      "minor": ""
    },
    "geo_ip": {
      "ip": "",
      "region_name": "",
      "continent_code": "",
      "location": {
        "lon": 0,
        "lat": 0
      },
      "latitude": 0,
      "timezone": "",
      "longitude": 0,
      "dma_code": 0,
      "postal_code": "",
      "region_code": "",
      "city_name": "",
      "country_code2": "",
      "country_code3": "",
      "country_name": ""
    },
    "modified_time": "",
    "last_name": "",
    "ip_address": "",
    "session_token": [
      ""
    ],
    "last_seen_time": "",
    "app_id": "",
    "org_id": ""
  },
  "sort": [
    0
  ]
}

Responses

Status Meaning Description Schema
200 OK success userResponse

Response Schema

Status Code 200

Name Type Required Description
» _id string false No description
» _source object false No description
»» first_name string false No description
»» body object false No description
»» name string false No description
»» email string false No description
»» first_seen_time string false No description
»» user_agent object false No description
»»» name string false No description
»»» os_major string false No description
»»» os string false No description
»»» os_name string false No description
»»» os_minor string false No description
»»» major string false No description
»»» device string false No description
»»» minor string false No description
»» geo_ip object false No description
»»» ip string false No description
»»» region_name string false No description
»»» continent_code string false No description
»»» location object false No description
»»»» lon double false No description
»»»» lat double false No description
»»» latitude double false No description
»»» timezone string false No description
»»» longitude double false No description
»»» dma_code integer false No description
»»» postal_code string false No description
»»» region_code string false No description
»»» city_name string false No description
»»» country_code2 string false No description
»»» country_code3 string false No description
»»» country_name string false No description
»» modified_time string false No description
»» last_name string false No description
»» ip_address string false No description
»» session_token [string] false No description
»» last_seen_time string false No description
»» app_id string false No description
»» org_id string false No description
» sort [integer] false No description

Delete a User

# You can also use wget
curl -X DELETE https://api.moesif.com/v1/search/{orgId}/users/{id} \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_APITOKEN'


const request = require('node-fetch');


const headers = {
  'Authorization':'Bearer YOUR_MANAGEMENT_APITOKEN'


};


fetch('https://api.moesif.com/v1/search/{orgId}/users/{id}',
{
  method: 'DELETE',


  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});


import requests
headers = {
  'Authorization': 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


r = requests.delete('https://api.moesif.com/v1/search/{orgId}/users/{id}', params={


}, headers = headers)


print r.json()


require 'rest-client'
require 'json'


headers = {
  'Authorization' => 'Bearer YOUR_MANAGEMENT_APITOKEN'
}


result = RestClient.delete 'https://api.moesif.com/v1/search/{orgId}/users/{id}',
  params: {
  }, headers: headers


p JSON.parse(result)


URL obj = new URL("https://api.moesif.com/v1/search/{orgId}/users/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());


DELETE /search/{orgId}/users/{id}

Parameters

Parameter In Type Required Description
orgId path string true No description
app_id query string false No description
id path string true No description

Responses

Status Meaning Description Schema
200 OK success None