GenFarmer ENG
  • ๐Ÿ‘‹Home
  • ๐Ÿ“ฑSetting GenFarmer
  • ๐Ÿ“ฒHow to Enable USB Debugging
  • Connect via USB and Power Off in Genfarmer
  • ๐Ÿ“กGuide to connecting OTG in GenFarmer
  • ๐Ÿ›žInstruction Manual for Using the GenFarmer Box Controller
  • MAIN MENU BAR
    • Control Center
      • Sidebar Menu
      • Stream Device
      • Group Control
      • Inspector
    • Automation
      • My Apps
      • My Modules
      • Runs
      • Saved Tasks
    • App Manager
    • Account Manager
    • Change/Backup
    • Devices
    • Billing
    • Settings
    • API
  • REAL-WORLD USE CASE
    • General Guide
Powered by GitBook
On this page
  • GenFarmer API Documentation
  • ๐Ÿง  Overview
  • ๐Ÿ“ฆ Base URL
  • ๐Ÿ“ Automation APIs
  • ๐Ÿงพ Task APIs
  • ๐Ÿš€ Run APIs
  • ๐Ÿ‘ค Me API
  • ๐Ÿ“˜ Notes
  • ๐Ÿ“ฅ Download Postman Collection
  • ๐Ÿ“ž Support
  1. MAIN MENU BAR

API

GenFarmer API Documentation

Welcome to the GenFarmer API documentation. This guide helps you understand how to interact with the GenFarmer automation system via RESTful APIs.


๐Ÿง  Overview

GenFarmer provides endpoints to manage Automation Apps, Tasks, and Runs that can be assigned to devices for automation scenarios.


๐Ÿ“ฆ Base URL

http://127.0.0.1:55554/

๐Ÿ“ Automation APIs

๐Ÿ” List Apps

  • Method: GET

  • Endpoint: /automation/apps

cURL Example:

curl -X GET 'http://127.0.0.1:55554/automation/apps?userId=3&page=1&limit=25&order=desc&orderBy=updatedAt'

๐Ÿ” Get App Details

  • Method: GET

  • Endpoint: /automation/apps/:id

cURL Example:

curl -X GET 'http://127.0.0.1:55554/automation/apps/adoFNVNN6Jwl8FlbZCfni'

๐Ÿ”ง Update App

  • Method: PUT

  • Endpoint: /automation/apps

cURL Example:

curl -X PUT 'http://127.0.0.1:55554/automation/apps' \
  -H 'Content-Type: application/json' \
  -d '{"id":"adoFNVNN6Jwl8FlbZCfni","userId":3,"name":"New App","description":"","version":"1.0.0","script":{"flow":{"nodes":[],"edges":[]}}}'

โŒ Delete App

  • Method: DELETE

  • Endpoint: /automation/apps

cURL Example:

curl -X DELETE 'http://127.0.0.1:55554/automation/apps' \
  -H 'Content-Type: application/json' \
  -d '{"ids": ["2ykTiCbEOAYC_5_tR5Wp-"]}'

๐Ÿงพ Task APIs

โž• Create Task

  • Method: POST

  • Endpoint: /automation/tasks

cURL Example:

curl -X POST 'http://127.0.0.1:55554/automation/tasks' \
  -H 'Content-Type: application/json' \
  -d '{"appId":"adoFNVNN6Jwl8FlbZCfni","input":[],"userId":3,"name":"test","devices":{"enable":true,"list":[]}}'

๐Ÿ“„ List Tasks

  • Method: GET

  • Endpoint: /automation/runs

cURL Example:

curl -X GET 'http://127.0.0.1:55554/automation/runs?userId=3&page=1&limit=25&order=desc&orderBy=createdAt'

๐Ÿ›  Update Task

  • Method: PUT

  • Endpoint: /automation/tasks/:id

cURL Example:

curl -X PUT 'http://127.0.0.1:55554/automation/tasks/uNDVKT_VwhEDuXT3PGUUv' \
  -H 'Content-Type: application/json' \
  -d '{"id":"uNDVKT_VwhEDuXT3PGUUv","userId":3,"appId":"adoFNVNN6Jwl8FlbZCfni","taskSource":0,"name":"test","input":[],"enableInput":true,"devices":{"enable":true,"list":[{"id":"emulator-5554","serialNo":"00f65a5d","name":"SM-G960N"}]}}'

๐Ÿ”— Assign Devices to Task

  • Method: PUT

  • Endpoint: /automation/tasks/:id/add-devices

cURL Example:

curl -X PUT 'http://127.0.0.1:55554/automation/tasks/uNDVKT_VwhEDuXT3PGUUv/add-devices' \
  -H 'Content-Type: application/json' \
  -d '{"devices":{"enabled":true,"list":[{"id":"emulator-5554","serialNo":"00f65a5d","name":"SM-G960N"}]}}'

๐Ÿ”— Remove Devices from Task

  • Method: PUT

  • Endpoint: /automation/tasks/:id/remove-devices

๐Ÿ—‘ Delete Task

  • Method: DELETE

  • Endpoint: /automation/tasks

cURL Example:

curl -X DELETE 'http://127.0.0.1:55554/automation/tasks' \
  -H 'Content-Type: application/json' \
  -d '{"ids": ["uNDVKT_VwhEDuXT3PGUUv"]}'

๐Ÿš€ Run APIs

โ–ถ๏ธ Create Run

  • Method: POST

  • Endpoint: /automation/runs

cURL Example:

curl -X POST 'http://127.0.0.1:55554/automation/runs' \
  -H 'Content-Type: application/json' \
  -d '{"userId":3,"taskId":"uNDVKT_VwhEDuXT3PGUUv","appId":"adoFNVNN6Jwl8FlbZCfni","status":0}'

โ–ถ๏ธ Execute Run

  • Method: PUT

  • Endpoint: /automation/runs/:id/run

cURL Example:

curl -X PUT 'http://127.0.0.1:55554/automation/runs/xhfjAeUOB5SXC8d5RiK_c/run' \
  -H 'Content-Type: application/json' \
  -d '{"deviceIds":[]}'

๐Ÿ“Š Get Run Output

  • Method: GET

  • Endpoint: /automation/runs/:id/storages

cURL Example:

curl -X GET 'http://127.0.0.1:55554/automation/runs/xhfjAeUOB5SXC8d5RiK_c/storages?page=1&limit=25'

๐Ÿ‘ค Me API

๐Ÿ™‹โ€โ™‚๏ธ Get Current User

  • Method: GET

  • Endpoint: /backend/auth/me

cURL Example:

curl -X GET 'http://127.0.0.1:55554/backend/auth/me'

๐Ÿ“˜ Notes

  • Replace all :id placeholders with the actual id of your app, task, or run.

  • The script.flow field in Update App allows defining an automation logic visually using nodes and edges.


๐Ÿ“ฅ Download Postman Collection

๐Ÿ“ž Support

For further help, please contact the GenFarmer support team.

PreviousSettingsNextGeneral Guide

Last updated 8 days ago

41KB
GenFarmer.postman_collection.json