Front end implementation

Last updated on
16 May 2019

Method GET

Front need to create one page with the URI that you set into settings.

On this page the front must to take the parameter which carrier the cid. You can get it :

-into JWT which is insde authorization headers JWT. No need to read cid here.

-into the url parameter with the key name that you set into settings. You need the cid and the key name.

With this "carrier", the front call the backoffice on graphql endpoint :

-if you got JWT send back the JWT into the authorization headers

-if you got url parameter send it back into url parameter

and this graphql query bellow :

{

previewGraphQLField
previewGraphQLUrlCallback

}

Then you will get the entire graphql result into "previewGraphQLField" field and the callback url form into "previewGraphQLUrlCallback"

Reminder "previewGraphQLField" must be json decode before to be ready for use.

Method POST

Front need to create one POST endpoint with the URI that you set into settings.

On this endpoint the front will recieved (under the key data) all data. With this data, front build the preview page and return the url of this preview page. To return this preview url page, you must to return under the key corresponding into your setting. This key name is also send into POST into "key_redirect_name".

After get the POST response, Drupal will redirect user on the preview page. 

Help improve this page

Page status: No known problems

You can: