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
  • Create a "Token" Site Link.
  • Create a Contact

Was this helpful?

Edit on Git
  1. Theme Core
  2. Authentication

Easy-Example

PreviousSite-to-Site-LinkNextPermissions

Last updated 1 year ago

Was this helpful?

Create a "Token" Site Link.

image

Notes:

  • Site 1: Your D.T instance

  • Site 2: Where you expect the webform to be used. It can be any url is this is not verified).

  • Connection Type: At leate "Create Contact" to give the permision needed.

  • Use Token As API KEY: This is required to keep the Authentication simple.

Create a Contact

Create a Post Request to your instance

POST: https://example.disciple.tools/wp-json/dt-posts/v2/contacts

Use the site key in the Authorization header Authorization: Bearer 14c5f0f1ebbc3c4b1042e884c1cf4e04410e274198928197c9ae726cbbe15b19

Usage:

$token = "token from the Site to Site link"
$args = [
  'method' => 'POST',
  'body' => $fields,
  'headers' => [
      'Authorization' => 'Bearer ' . $token,
  ],
];
return wp_remote_post( 'https://example.disciple.tools/wp-json/dt-posts/v2/contacts', $args );

$fields need to be in the format specified in

Fields Format