AgStack Foundation Field Registration (POST) API

The Field Registration (POST) API from AgStack Foundation — 4 operation(s) for field registration (post).

Documentation

Specifications

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-predictionout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-weatherdataout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-thidataout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-sprayforecastresponse-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-flightstatusforecastresponse-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-geojsonout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-jsonldgraph-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-authtoken-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-pointout-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-validationerror-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-httpvalidationerror-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-openagri-weather-service-body-token-auth-token-post-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-predictionout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-weatherdataout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-thidataout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-sprayforecastresponse-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-flightstatusforecastresponse-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-geojsonout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-jsonldgraph-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-authtoken-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-pointout-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-validationerror-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-httpvalidationerror-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-openagri-weather-service-body-token-auth-token-post-structure.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-asset-registry-registerfieldwktrequest-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-asset-registry-geojsonfeaturecollection-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-schema/agstack-asset-registry-bulkpointresult-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-asset-registry-registerfieldwktrequest-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-asset-registry-geojsonfeaturecollection-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/json-structure/agstack-asset-registry-bulkpointresult-structure.json

Other Resources

🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-predictionout-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-weatherdataout-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-thidataout-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-sprayforecastresponse-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-flightstatusforecastresponse-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-geojsonout-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-jsonldgraph-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-authtoken-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-pointout-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-validationerror-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-httpvalidationerror-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-openagri-weather-service-body-token-auth-token-post-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-asset-registry-registerfieldwktrequest-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-asset-registry-geojsonfeaturecollection-example.json
🔗
Examples
https://raw.githubusercontent.com/api-evangelist/agstack/refs/heads/main/examples/agstack-asset-registry-bulkpointresult-example.json

OpenAPI Specification

agstack-field-registration-post-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: AgStack Asset Registry api Field Registration (POST) API
  version: 1.0.0
  description: 'Welcome to the **AgStack Asset Registry** developer portal.


    ---


    ## 🔐 Authentication Guide


    | Service Zone | HTTP Method | Credential Type |

    | :--- | :---: | :--- |

    | **Authentication** | `GET/POST` | **Bearer Token** (where applicable) |

    | **Field Registration** | `POST` | **Bearer Token** |

    | **Field Retrieval** | `GET/POST`| **Bearer Token** (where applicable) |



    > 🚀 **Quick Start Guide**

    > 1. Login via `/login` to get an `access_token` and `refresh_token`.

    > 2. Use `Bearer_Token` (Lock Icon) to authorize protected routes.

    '
servers:
- url: https://api-ar.agstack.org
  description: Production Server
tags:
- name: Field Registration (POST)
paths:
  /register-field-boundary:
    post:
      tags:
      - Field Registration (POST)
      summary: 📍 Register Field Boundary (WKT)
      security:
      - Bearer_Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterFieldWKTRequest'
      responses:
        '200':
          description: Field Boundary registered successfully or already exists.
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /register-field-boundaries-geojson:
    post:
      tags:
      - Field Registration (POST)
      summary: 📂 Bulk Register Field Boundaries (GeoJSON File)
      description: "Bulk register Field Boundaries using a GeoJSON FeatureCollection. \nSupports both multipart file upload (`.geojson`) and raw JSON body.\n"
      security:
      - Bearer_Token: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Upload a valid .geojson file
      responses:
        '200':
          description: Bulk registration completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  results:
                    type: array
                    items:
                      type: object
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /register-point:
    post:
      tags:
      - Field Registration (POST)
      summary: 🎯 Register a Point
      security:
      - Bearer_Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - wkt
              properties:
                wkt:
                  type: string
                  example: POINT(75.78209 30.90706)
                s2_index:
                  type: string
                  example: 8,13
      responses:
        '200':
          description: Point registered successfully
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /register-points-geojson:
    post:
      tags:
      - Field Registration (POST)
      summary: 📂 Bulk Register Points (GeoJSON)
      description: "Bulk register points using a GeoJSON FeatureCollection. \nSupports both multipart file upload (`.geojson`) and raw JSON body.\n"
      security:
      - Bearer_Token: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Upload a valid .geojson file containing Point features.
          application/json:
            schema:
              $ref: '#/components/schemas/GeoJSONFeatureCollection'
      responses:
        '200':
          description: Bulk point registration completed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Bulk point registration completed
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/BulkPointResult'
        '400':
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    RegisterFieldWKTRequest:
      type: object
      required:
      - wkt
      properties:
        wkt:
          type: string
          example: POLYGON((75.78209 30.90706, 75.78211 30.90645, 75.78270 30.90654, 75.78262 30.90714, 75.78209 30.90706))
        threshold:
          type: integer
          default: 95
          description: Percentage overlap threshold
        return_s2_indices:
          type: boolean
          default: false
        s2_index:
          type: string
          example: 8,13
          description: Comma-separated list of resolution levels
    GeoJSONFeatureCollection:
      type: object
      required:
      - type
      - features
      properties:
        type:
          type: string
          enum:
          - FeatureCollection
        features:
          type: array
          items:
            type: object
            required:
            - geometry
            properties:
              type:
                type: string
                example: Feature
              geometry:
                type: object
                required:
                - type
                - coordinates
                properties:
                  type:
                    type: string
                    enum:
                    - Point
                  coordinates:
                    type: array
                    items:
                      type: number
                    example:
                    - 75.78209
                    - 30.90706
              properties:
                type: object
                description: Optional properties like s2_index
                properties:
                  s2_index:
                    type: string
                    example: 8,13
    BulkPointResult:
      type: object
      properties:
        status:
          type: string
          example: created
        message:
          type: string
          example: Point registered successfully.
        Geo Id:
          type: string
        Geo JSON:
          type: object
  responses:
    ErrorResponse:
      description: Generic Error Response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Error description
              error:
                type: string
                example: Detailed exception message
  securitySchemes:
    Bearer_Token:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '**Required for most operations.**

        1. Login via `/login` to get token.

        2. Paste access token here.

        '