> For the complete documentation index, see [llms.txt](https://developers.disciple.tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.disciple.tools/theme-core/authentication/easy-example.md).

# Easy-Example

## Create a "Token" Site Link.

![image](https://github.com/DiscipleTools/Documentation/assets/24901539/0c92e588-974c-46e1-8f8e-97c5dccb9759)

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:

```php
$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](https://github.com/DiscipleTools/Documentation/blob/master/theme-core/authentication/theme-core/api-posts/post-types-fields-format.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.disciple.tools/theme-core/authentication/easy-example.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
