-
Notifications
You must be signed in to change notification settings - Fork 2
tp TouchPointWP api
James K. edited this page Nov 19, 2025
·
5 revisions
This class handles communication with the TouchPoint API.
- Class name: Api
- Namespace: \tp\TouchPointWP
const MAX_API_CALLS = 20
public mixed parent = null
The main plugin object.
- Visibility: public
mixed tp\TouchPointWP\Api::__construct(\tp\TouchPointWP\TouchPointWP parent)
Constructor function.
- Visibility: public
- parent tp\TouchPointWP\TouchPointWP - Parent object.
- mixed
\tp\TouchPointWP\Api tp\TouchPointWP\Api::instance(?\tp\TouchPointWP\TouchPointWP parent)
Main Api Instance
Ensures only one instance of Api is loaded or can be loaded.
- Visibility: public
- This method is static.
- parent ?\tp\TouchPointWP\TouchPointWP - Object instance.
- \tp\TouchPointWP\Api - instance
array|\WP_Error tp\TouchPointWP\Api::uGet(string command, array parameters, array headers, ?int onBehalfPid, int timeout, float timeTaken)
Gets data from the API with Basic User Auth.
This method is provided until TouchPoint has been updated to allow PAT authentication on more endpoints. The signature is identical to the PAT version so replacement later should be easy, however, onbehalf
- Visibility: public
- command string - The API endpoint to call
- parameters array* headers array - Headers to send with the request.
- onBehalfPid ?int - The PID of the user to act on behalf of.
- timeout int - Amount of time in sec to wait before timing out.
- timeTaken float - The time taken to complete the request.
- array|\WP_Error - An array with headers, body, and other keys
\stdClass|array tp\TouchPointWP\Api::pyGet(string command, ?array parameters, int timeout, mixed verbose)
Gets data from the API via the python script.
- Visibility: public
- command string - The thing to get
- parameters ?array - URL parameters to be added.
- timeout int - Amount of time in sec to wait before timing out.
- verbose mixed
- \stdClass|array - An array with headers, body, and other keys Data is generally in json_decode($response['body'])->data
\stdClass|array tp\TouchPointWP\Api::pyPost(string command, ?mixed data, int timeout, float timeTaken)
Do a POST to the Python-Defined API.
- Visibility: public
- command string - The thing to post
- data ?mixed - Data to post
- timeout int - Amount of time in sec to wait before timing out.
- timeTaken float - The time taken to complete the request.
- \stdClass|array - An object that corresponds to the Data python object in TouchPoint.
array|\WP_Error tp\TouchPointWP\Api::get(string command, array parameters, array headers, ?int onBehalfPid, int timeout, float timeTaken)
Do a GET to the standard API using a PAT.
- Visibility: public
- command string - The API endpoint to call
- parameters array - URL parameters to be added.
- headers array - Headers to send with the request.
- onBehalfPid ?int - The PID of the user to act on behalf of.
- timeout int - Amount of time in sec to wait before timing out.
- timeTaken float - The time taken to complete the request.
- array|\WP_Error - The response from the Http request call.
array|\WP_Error tp\TouchPointWP\Api::post(string command, ?mixed data, array headers, ?int onBehalfPid, int timeout, float timeTaken)
Do a POST to the standard API using a PAT.
- Visibility: public
- command string - The API endpoint to call
- data ?mixed - Data to post
- headers array - Headers to send with the request.
- onBehalfPid ?int - The PID of the user to act on behalf of.
- timeout int - Amount of time in sec to wait before timing out.
- timeTaken float - The time taken to complete the request.
- array|\WP_Error - The response from the Http request call.
void tp\TouchPointWP\Api::invalidatePAT()
Invalidate the existing PAT, both here and on the server.
- Visibility: public
Documentation generated November 19, 2025 1:15am.
- Simple RSVP
- People Lists
- Involvements
- Outreach Partners
- SQL & Python Reports
- Events Calendar from Meetings (Beta)
- Events Calendar Plugin Integration (Deprecated)
- tp
- tp\TouchPointWP
- Api
- Auth
- tp\TouchPointWP\Blocks
- CalendarGrid
- EventsCalendar
- ExtraValueHandler
- Geo
- tp\TouchPointWP\Interfaces
- Involvement
- Involvement_PostTypeSettings
- InvolvementMembership
- Location
- Meeting
- MeetingArray
- Partner
- Person
- PostTypeCapable
- RegistrationType
- Report
- Rsvp
- Settings
- Stats
- StatusWidget
- Taxonomies
- TouchPointWP
- TouchPointWP_AdminAPI
- TouchPointWP_Exception
- TouchPointWP_WPError
- Utilities
- tp\TouchPointWP