Dev Docs
  • Disciple.Tools Technical Documentation
  • Theme Core
    • API - Posts
      • List of Endpoints
      • Fields Format
      • Get Post
      • Create Post
      • Update Post
      • Post Comments
      • Post Activity
      • List Query
      • Global Search
      • Posts in Typeaheads
      • Post-Sharing
      • Get Following
      • Settings
    • API - Other
      • Users
      • Locations
      • Settings
    • Hooks
      • Record Page Hooks
      • API-Hooks
      • Public settings
      • Adding menu navigation links
    • Customization
      • Fields
      • Custom Post Types
      • Post Type Modules
      • Adding Fields and Tiles.
    • Authentication
      • JWT-Authentication-for-the-mobile-app
      • Site-to-Site-Link
      • Easy-Example
    • Permissions
    • Roles and Permissions
    • Database Tables
      • Activity Table
    • Disciple.Tools Translation
    • Revisions
      • v1.0.0-dev-changes
      • v1.0
  • Hosting
    • 404 Errors on new install
    • CRON
    • Hosting on WPEngine
    • Backups
    • Single Site or MultiSite
  • Disciple.Tools Development Setup
    • LocalWP
    • Mobile App Setup
    • Unit Tests
    • Cypress Tests
    • D.T on Docker Setup
    • Gulp - CSS and JS
  • Code Contribution
    • Theme Contribution Guidelines
    • How to Correctly Contribute to the Disciple Tools Repository
    • How to Translate Your Plugin
  • Style Guide
  • Disciple.Tools Code of Conduct
Powered by GitBook
On this page
  • Get My User Info
  • Parameters
  • Returns
  • Update My User Details
  • Parameters
  • Returns
  • List Users
  • Parameters
  • Returns

Was this helpful?

Edit on Git
  1. Theme Core
  2. API - Other

Users

PreviousAPI - OtherNextLocations

Last updated 2 years ago

Was this helpful?

Get My User Info

Get

Parameters

Returns

[
    "ID": 1,
    "user_email": "user@example.com",
    "display_name": "BOB JOE",
    "locale": "fr_FR",
    "locations": {
      "location_grid": [{
        "id": 100306693,
        "label": "Poland"
      }],
      "location_grid_meta": [{
        "grid_id": "100306693",
        "grid_meta_id": "66",
        "label": "Poland",
        "lat": "52.124609907545",
        "level": "admin0",
        "lng": "19.30063630556",
        "post_id": "1",
        "post_type": "users",
        "postmeta_id_location_grid": "573",
        "source": "user"
      }]
    },
    "apps": [
      {
        "description": "An update summary of assigned contacts.",
        "label": "User Contact Updates",
        "link": "http://...."
      }
    ],
    "notifications": {
      "email_preference": {
        "daily": false,
        "hourly": false,
        "realtime": true
      },
      "follow_all": false,
      "notify_types": [
        {
          "channels": [
            {
              "enabled": true,
              "key": "email",
              "label": "Email"
            },
            {
              "enabled": true,
              "key": "web",
              "label": "Web"
            },
            {
              "enabled": false,
              "key": "push_notifications",
              "label": "Push Notifications"
            }
          ],
          "key": "new_assigned",
          "label": "Newly Assigned Contact"
        }
      ]
    },
    "preferences": {
      "languages": [
        {
          "key": "fr",
          "label": "French"
        },
        {
          "key": "es",
          "label": "Spanish"
        }
      ],
      "locations": {
        "location_grid": [{
          "id": 100306693,
          "label": "Poland"
        }],
        "location_grid_meta": [{
          "grid_id": "100306693",
          "grid_meta_id": "66",
          "label": "Poland",
          "lat": "52.124609907545",
          "level": "admin0",
          "lng": "19.30063630556",
          "post_id": "1",
          "post_type": "users",
          "postmeta_id_location_grid": "573",
          "source": "user"
        }]
      },
      "people_groups": [
        {
          "ID": "13",
          "post_title": "Arab Egyptian"
        },
        {
          "ID": "20",
          "post_title": "Algerian, Arabic-speaking"
        }
      ],
      "workload": {
        "color": "#4caf50",
        "id": "active",
        "label": "Accepting new contacts"
      }
    },
    "profile": {
      "ID": 1,
      "address": [],
      "bio": "This has been my journey so far....",
      "display_name": "admin",
      "email": [
        {
          "label": "admin@dtdev.local",
          "value": "admin@dtdev.local"
        }
      ],
      "gender": "male",
      "language": "English (United States)",
      "locale": "en_US",
      "name": "Administrator",
      "nickname": "admin",
      "other": [],
      "phone": [],
      "roles": {
        "administrator": "Administrator"
      },
      "social": [],
      "username": "admin"
    },
    "unavailability": [
      {
        "id": 1,
        "start_date": "2022-06-13",
        "end_date": "2022-06-17"
      },
      {
        "id": 2,
        "start_date": "2022-06-20",
        "end_date": "2022-06-24"
      }
    ]
]

Update My User Details

Parameters

  • locale (string) optional. The new user locale

Returns

true on success. WP_ERROR if not

List Users

Parameters

  • s (string) optional. Search user display names

  • get_all (string) optional. Return all the users. Default false. "1" for true

Returns

[
    "ID": 1,
    "name": "BOB JOE",
    "avatar": "http://2.gravatar.com/avatar/x?s=16&d=mm&r=g"
]

POST

Get

https://example.com/wp-json/dt/v1/user/my
https://example.com/wp-json/dt/v1/user/update
https://example.com/wp-json/dt/v1/users/get_users