RRUFUS Help

Sessões

POST/sessions

Criar sessão

Requer o tipo de acesso por chave WRITE ou READ_WRITE api.

URL basehttps://api.runonrufus.com/v0
AutenticaçãoCabeçalho da chave de API

Autenticação

Envie um dos cabeçalhos de chave de API compatíveis em cada solicitação.

api_keyAPI key for authentication.
x-api-keyAPI key for authentication (alternate header).

Corpo da solicitação

application/json
CampoTipoObrigatórioDescrição
deviceidstringObrigatório
aliasstringOpcional

Respostas

201Session inserted succesfullyCreateSessionResponse
400Bad requestEnvelopeAny
403ForbiddenEnvelopeAny
404Not foundEnvelopeAny
409ConflictEnvelopeNull
500Internal server errorEnvelopeNull
curl --request POST \
  --url 'https://api.runonrufus.com/v0/sessions' \
  --header 'accept: application/json' \
  --header 'api_key: YOUR_API_KEY' \
  --header 'content-type: application/json' \
  --data '{
  "deviceid": "DEVICE_ID",
  "alias": "string"
}'
Operação OpenAPI original
{
  "openapi": "3.0.3",
  "info": {
    "title": "RUFUS Public REST API",
    "version": "0.1.0"
  },
  "tags": [
    {
      "name": "Sessions"
    }
  ],
  "servers": [
    {
      "url": "https://api.runonrufus.com/v0",
      "description": "Production (v0)"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "XApiKeyHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "api_key",
        "description": "API key for authentication."
      },
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication (alternate header)."
      }
    },
    "schemas": {
      "CreateSessionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "deviceid": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          }
        },
        "required": [
          "deviceid"
        ]
      },
      "CreateSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "token_session": {
                "type": "string"
              }
            },
            "required": [
              "description",
              "token_session"
            ]
          }
        },
        "required": [
          "body"
        ]
      },
      "EnvelopeAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "Operation result body."
          }
        }
      },
      "EnvelopeNull": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true
          }
        },
        "required": [
          "body"
        ]
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeNull"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/sessions": {
      "post": {
        "tags": [
          "Sessions"
        ],
        "summary": "Create session",
        "description": "Requires `WRITE` or `READ_WRITE` api key access type.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Session inserted succesfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvelopeNull"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
GET/sessions/{token_session}

Obter sessão por token

Requer o tipo de acesso por chave READ ou READ_WRITE api.

URL basehttps://api.runonrufus.com/v0
AutenticaçãoCabeçalho da chave de API

Autenticação

Envie um dos cabeçalhos de chave de API compatíveis em cada solicitação.

api_keyAPI key for authentication.
x-api-keyAPI key for authentication (alternate header).

Respostas

200SuccessSessionGetResponse
403ForbiddenEnvelopeAny
404Not foundEnvelopeAny
500Internal server errorEnvelopeNull
curl --request GET \
  --url 'https://api.runonrufus.com/v0/sessions/{token_session}' \
  --header 'accept: application/json' \
  --header 'api_key: YOUR_API_KEY'
Operação OpenAPI original
{
  "openapi": "3.0.3",
  "info": {
    "title": "RUFUS Public REST API",
    "version": "0.1.0"
  },
  "tags": [
    {
      "name": "Sessions"
    }
  ],
  "servers": [
    {
      "url": "https://api.runonrufus.com/v0",
      "description": "Production (v0)"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "XApiKeyHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "api_key",
        "description": "API key for authentication."
      },
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication (alternate header)."
      }
    },
    "schemas": {
      "SessionGetResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "result": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SessionDetails"
                }
              }
            },
            "required": [
              "description"
            ]
          }
        },
        "required": [
          "body"
        ]
      },
      "SessionDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token_session": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "creation_date": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "passings": {
            "type": "integer",
            "minimum": 0
          },
          "first": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "last": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "required": [
          "token_session",
          "alias",
          "active"
        ]
      },
      "EnvelopeAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "Operation result body."
          }
        }
      },
      "EnvelopeNull": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true
          }
        },
        "required": [
          "body"
        ]
      }
    },
    "responses": {
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeNull"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/sessions/{token_session}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Get session by token",
        "description": "Requires `READ` or `READ_WRITE` api key access type.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionGetResponse"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
GET/sessions/device/{deviceid}

Listar sessões por dispositivo

Requer o tipo de acesso por chave READ ou READ_WRITE api.

URL basehttps://api.runonrufus.com/v0
AutenticaçãoCabeçalho da chave de API

Autenticação

Envie um dos cabeçalhos de chave de API compatíveis em cada solicitação.

api_keyAPI key for authentication.
x-api-keyAPI key for authentication (alternate header).

Respostas

200SuccessSessionsListResponse
403ForbiddenEnvelopeAny
404Not foundEnvelopeAny
500Internal server errorEnvelopeNull
curl --request GET \
  --url 'https://api.runonrufus.com/v0/sessions/device/{deviceid}' \
  --header 'accept: application/json' \
  --header 'api_key: YOUR_API_KEY'
Operação OpenAPI original
{
  "openapi": "3.0.3",
  "info": {
    "title": "RUFUS Public REST API",
    "version": "0.1.0"
  },
  "tags": [
    {
      "name": "Sessions"
    }
  ],
  "servers": [
    {
      "url": "https://api.runonrufus.com/v0",
      "description": "Production (v0)"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "XApiKeyHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "api_key",
        "description": "API key for authentication."
      },
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication (alternate header)."
      }
    },
    "schemas": {
      "SessionsListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "result": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SessionSummary"
                }
              }
            },
            "required": [
              "description"
            ]
          }
        },
        "required": [
          "body"
        ]
      },
      "SessionSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token_session": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "creation_date": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "passings": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "token_session",
          "alias",
          "active"
        ]
      },
      "EnvelopeAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "Operation result body."
          }
        }
      },
      "EnvelopeNull": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true
          }
        },
        "required": [
          "body"
        ]
      }
    },
    "responses": {
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeNull"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/sessions/device/{deviceid}": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "List sessions by device",
        "description": "Requires `READ` or `READ_WRITE` api key access type.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionsListResponse"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
GET/sessions/device/{deviceid}/active

Obter sessão ativa para o dispositivo

Requer o tipo de acesso por chave READ ou READ_WRITE api.

URL basehttps://api.runonrufus.com/v0
AutenticaçãoCabeçalho da chave de API

Autenticação

Envie um dos cabeçalhos de chave de API compatíveis em cada solicitação.

api_keyAPI key for authentication.
x-api-keyAPI key for authentication (alternate header).

Respostas

200SuccessSessionsListResponse
403ForbiddenEnvelopeAny
404Not foundEnvelopeAny
500Internal server errorEnvelopeNull
curl --request GET \
  --url 'https://api.runonrufus.com/v0/sessions/device/{deviceid}/active' \
  --header 'accept: application/json' \
  --header 'api_key: YOUR_API_KEY'
Operação OpenAPI original
{
  "openapi": "3.0.3",
  "info": {
    "title": "RUFUS Public REST API",
    "version": "0.1.0"
  },
  "tags": [
    {
      "name": "Sessions"
    }
  ],
  "servers": [
    {
      "url": "https://api.runonrufus.com/v0",
      "description": "Production (v0)"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "XApiKeyHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "api_key",
        "description": "API key for authentication."
      },
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication (alternate header)."
      }
    },
    "schemas": {
      "SessionsListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "result": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SessionSummary"
                }
              }
            },
            "required": [
              "description"
            ]
          }
        },
        "required": [
          "body"
        ]
      },
      "SessionSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token_session": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "creation_date": {
            "type": "string",
            "format": "date-time"
          },
          "duration": {
            "type": "number",
            "nullable": true
          },
          "active": {
            "type": "boolean"
          },
          "passings": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "token_session",
          "alias",
          "active"
        ]
      },
      "EnvelopeAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "Operation result body."
          }
        }
      },
      "EnvelopeNull": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true
          }
        },
        "required": [
          "body"
        ]
      }
    },
    "responses": {
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeNull"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/sessions/device/{deviceid}/active": {
      "get": {
        "tags": [
          "Sessions"
        ],
        "summary": "Get active session for device",
        "description": "Requires `READ` or `READ_WRITE` api key access type.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionsListResponse"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
PATCH/sessions/close/{token_session}

Encerrar sessão

Requer o tipo de acesso por chave WRITE ou READ_WRITE api.

URL basehttps://api.runonrufus.com/v0
AutenticaçãoCabeçalho da chave de API

Autenticação

Envie um dos cabeçalhos de chave de API compatíveis em cada solicitação.

api_keyAPI key for authentication.
x-api-keyAPI key for authentication (alternate header).

Respostas

200Session closed succesfullyCloseSessionResponse
403ForbiddenEnvelopeAny
404Not foundEnvelopeAny
500Internal server errorEnvelopeNull
curl --request PATCH \
  --url 'https://api.runonrufus.com/v0/sessions/close/{token_session}' \
  --header 'accept: application/json' \
  --header 'api_key: YOUR_API_KEY'
Operação OpenAPI original
{
  "openapi": "3.0.3",
  "info": {
    "title": "RUFUS Public REST API",
    "version": "0.1.0"
  },
  "tags": [
    {
      "name": "Sessions"
    }
  ],
  "servers": [
    {
      "url": "https://api.runonrufus.com/v0",
      "description": "Production (v0)"
    }
  ],
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "XApiKeyHeader": []
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "api_key",
        "description": "API key for authentication."
      },
      "XApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "API key for authentication (alternate header)."
      }
    },
    "schemas": {
      "CloseSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "description": {
                "type": "string"
              },
              "token_session": {
                "type": "string"
              }
            },
            "required": [
              "description",
              "token_session"
            ]
          }
        },
        "required": [
          "body"
        ]
      },
      "EnvelopeAny": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "description": "Operation result body."
          }
        }
      },
      "EnvelopeNull": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "body": {
            "nullable": true
          }
        },
        "required": [
          "body"
        ]
      }
    },
    "responses": {
      "Forbidden": {
        "description": "Forbidden",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeAny"
            }
          }
        }
      },
      "InternalError": {
        "description": "Internal server error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeNull"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/sessions/close/{token_session}": {
      "patch": {
        "tags": [
          "Sessions"
        ],
        "summary": "Close session",
        "description": "Requires `WRITE` or `READ_WRITE` api key access type.",
        "responses": {
          "200": {
            "description": "Session closed succesfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CloseSessionResponse"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    }
  }
}
Este artigo foi útil?Nossa equipe está aqui quando você precisar de ajuda.
Falar com o suporte