Create registration form with JetFormBuilder

Crocoblock-728X90-light.jpgWith the help of the JetEngine plugins from crocoblock, you can easily display data from our software on your WordPress site.

Proceed as follows:

Preparation

  1. Request a non-expiring token via our REST interface (function: /nonexptoken). You can use Swagger on our interface or Postman.
  2. Purchase the JetEngine plugin from crocoblock and install it in your WordPress.
  3. 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

  1. REST API URL: https://api.beyond-sw.ch/anmeldungen
  2. Custom Body: Link the fields of the form with those of our interface via a valid JSON
  3. Authorisation: Yes
  4. Authorisation type: Bearer token
  5. 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;

} );
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.