With the help of the JetEngine plugins from crocoblock, you can easily display data from our software on your WordPress site.
Proceed as follows:
Preparation
- Request a non-expiring token via our REST interface (function: /nonexptoken). You can use Swagger on our interface or Postman.
- Purchase the JetEngine plugin from crocoblock and install it in your WordPress.
- Install the JetFormBuilder plugin
Create the form
Create the form with the desired fields. Add a REST API request to Post Submit Actions. Use the following properties
- REST API URL: https://api.beyond-sw.ch/anmeldungen
- Custom Body: Link the fields of the form with those of our interface via a valid JSON
- Authorisation: Yes
- Authorisation type: Bearer token
- Bearer token: Insert the token that you received during preparation in step 1.
Example of a valid json (step 2)
{
‘kursId’: ‘%kursId%’,
‘remarks’: ‘%remarks%’,
‘addresses1’: {
‘gender’: ‘%LeadGender%’,
‘lastName’: ‘%LeadLastName%’,
‘firstname’: ‘%LeadFirstName%’,
‘streetP’: ‘%LeadAddress%’,
‘plzp’: ‘%LeadPLZ%’,
‘cityP’: ‘%LeadCity%’,
‘telefonN’: ‘%LeadTelefon%’,
‘eMail1’: ‘%LeadEMail%’
},
‘gender1’: ‘m’
}
Set the enpoint filter for JetFormBuilder
Insert the following code. You can use the Code Snippets plug-in for this, for example.
add_filter( ‘jet-engine/rest-api-listings/form-notification/endpoint-data’, function( $endpoint ) {
if ( false === strpos( $endpoint[‘url’], ‘https://api.beyond-sw.ch’ ) ) {
return $endpoint;
}
$endpoint[‘args’][‘headers’][‘Content-Type’] = ‘application/json’;
$endpoint[‘args’][‘body’] = json_encode( $endpoint[‘args’][‘body’] );
return $endpoint;
} );
Comments
Please sign in to leave a comment.