> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mileapp.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Read data source



## OpenAPI

````yaml /openapi/public/openapi-data.json get /data
openapi: 3.0.0
info:
  title: MileApp API - Data
  version: 3.0.0
  description: MileApp API Documentation - RESTful API for field operations management.
servers:
  - url: https://apiweb.mile.app/api/v3
security:
  - bearerAuth: []
tags:
  - name: Data Source
    description: >-
      The Data source could help you simplify the process of filling in task
      information based on existing data at MileApp. This data could consist of
      information such as name, number, date, coordinate, and multiple options.
      The Data typically represents entities such as customers, products,
      employees, suppliers, or any other critical data elements that are used
      across the application.


      **To see the details of data source object, please follow [this
      link](#tag/data_source_model)**
  - name: Data Type
    description: >-
      The Data type is the structure of data fields that is customizable to suit
      your business needs. Data type attributes consist of IDs, name, field
      details, type, and primary key. This data type structure will be used at
      Data Source and Flow.


      **To see the details of data type object, please follow [this
      link](#tag/data_type_model)**
paths:
  /data:
    get:
      tags:
        - Data Source
      summary: Read data source
      operationId: getData
      parameters:
        - $ref: '#/components/parameters/pageInQuery'
        - name: limit
          in: query
          required: false
          schema:
            type: integer
          description: >-
            Specifies the maximum number of items to retrieve in a single
            request. **Example:** `10`. **Default:** `20`
        - name: fields
          in: query
          required: false
          description: >-
            Fields is for selecting the specific fields that you can choose by
            multiples to show in the response using a string with a comma
            delimiter. If the user's role has field accessibility configured,
            requesting a hidden field returns a `403 Forbidden` error.

            **Example:** `dataId,dataTypeId,organizationId`
          schema:
            type: string
        - name: sortBy
          in: query
          required: false
          description: >-
            sortBy is used to sort the result-set in ascending or descending
            order according to selected field. The value of this param is one of
            available fields on data source objects.

            **Example:** `dataId`, `dataTypeId`, `hubId`, etc.

            **Default:** `createdTime`
          schema:
            type: string
        - name: sortOrder
          in: query
          required: false
          description: |-
            sortOrder is to decide ascending or descending order
            **Example:** `asc` or `desc`.
            **Default:** `desc`
          schema:
            type: string
        - $ref: '#/components/parameters/hubIdInQuery'
        - name: dataId
          in: query
          required: false
          description: >-
            Name or unique identifier value associated with data source. You can
            do a multipe filter `dataId` using separator coma (,)

            **Example:** `Outlet` or `Outlet,Toko`
          schema:
            type: string
        - name: dataTypeId
          in: query
          required: false
          description: >-
            The identifier for Data Type. Use [GET /data-types
            API](#tag/Data-Type/operation/getDataType) to get the list of Data
            Type IDs.

            **Example:** `63db2fb476bc679c540369c4`
          schema:
            type: string
        - name: dataTypeName
          in: query
          required: false
          description: >-
            Name of data type. Use [GET /data-types
            API](#tag/Data-Type/operation/getDataType) to get the list of
            dataType Name.

            **Example:** `Pegawai`
          schema:
            type: string
        - name: updatedTime
          in: query
          required: false
          description: |-
            The time at which the data is updated.
            **Example:** `2023-07-06T06:41:08`
          schema:
            type: string
            format: date-time
        - name: limitUser
          in: query
          required: false
          description: >-
            Parameter to restrict data source based on user. The default value
            of this parameter is true. If `limitUser` is true, the data source
            will be limited based on user. and if `limitUser` is false, data
            source will show all data without any limitation based on user. 

            **Example:** `false`
          schema:
            type: boolean
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                title: NetworkReadResponse
                properties:
                  status:
                    type: boolean
                    description: Status of response.
                  message:
                    description: Message of API response.
                    type: string
                  data:
                    description: List of object data source.
                    type: object
                    additionalProperties: true
                example:
                  status: true
                  message: Success
                  data:
                    current_page: 1
                    data:
                      - _id: 63dc641b1ed1fd63ad0c9013
                        dataId: Outlet
                        dataTypeId: 63db2fb476bc679c540369c4
                        outletName: Cabang Jakarta Pusat
                        outletHours: 12
                        outletType: minimarket
                        outletOpen: '09:00'
                        outletClosed: '17:00'
                        outletContractExpired: '2023-02-02'
                        outletOpenInWeekend: true
                        outletGeolocation: '-6.171702325136309,106.81775093078615'
                        outletPhoneNumber: +62 123 456 789
                        outletCloseOrder: '2023-02-02 17:00:00'
                        data_type:
                          _id: 660cd7c159fcd16a3a2e6537
                          name: outlets
                        hubId: 63c63ab1b6972d3150348172
                        organizationId: 63c61d865347e356d05e3052
                        updatedBy: john.doe@mile.app
                        createdBy: john.doe@mile.app
                        updatedTime: '2023-02-03 01:32:11'
                        createdTime: '2023-02-03 01:32:11'
                    first_page_url: https://apiweb.mile.app/v3/data?page=1
                    from: 1
                    last_page: 1
                    last_page_url: https://apiweb.mile.app/v3/data?page=1
                    links:
                      - url: null
                        label: '&laquo; Previous'
                        active: false
                      - url: https://apiweb.mile.app/v3/data?page=1
                        label: '1'
                        active: true
                      - url: null
                        label: Next &raquo;
                        active: false
                    next_page_url: null
                    path: https://apiweb.mile.app/v3/data
                    per_page: 20
                    prev_page_url: null
                    to: 15
                    total: 15
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Shows if the request was successful.
                  message:
                    type: string
                    description: A short message explaining what went wrong.
                example:
                  status: false
                  message: Bad request - invalid parameters provided.
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Shows if the request was successful.
                  message:
                    type: string
                    description: A short message explaining what went wrong.
                example:
                  status: false
                  message: Internal server error, please contact support@mile.app.
      deprecated: false
      security:
        - bearerAuth: []
components:
  parameters:
    pageInQuery:
      name: page
      in: query
      schema:
        default: 1
        type: integer
      description: The page number of results to retrieve. **Example:** `2`
    hubIdInQuery:
      name: hubId
      in: query
      schema:
        type: string
      description: >-
        Fundamental entity within an organization, serving as the central point
        for managing various operational components. Use Use [**GET
        /hubs**](#tag/Hub/operation/getHubs) endpoint to get the list of Hub
        IDs.

        **Example:** `634e98498ce07d29474a7e29`
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Use a valid Bearer token to authenticate.

````