Skip to content

Export questionnaire from Prepod and Import into local Author

tjamesmac edited this page May 14, 2020 · 5 revisions

The process will entail showing the questionnaire in JSON format, copying that and your local auth bearer token into the Postman application and posting a request to your local Author session to load the JSON of the questionnaire which will be available when you navigate back to your local Author home page.

Step 1: Copy the JSON

  1. Go to a questionnaire e.g. -

    https://preprod-author.eq.ons.digital/#/q/9d59571f-329e-409c-b131-f46e10e34529/introduction/235143c1-a44f-4404-beb4-c4f729000a2e/design

  2. Copy the <author-id> part from the path, in the previous example that would be

    9d59571f-329e-409c-b131-f46e10e34529

  3. Add the <author-id> to the export route to display the JSON

    

https://preprod-author.eq.ons.digital/export/ 



    and using the example questionnaire we get

    https://preprod-author.eq.ons.digital/export/9d59571f-329e-409c-b131-f46e10e34529



  4. Goto url and copy the displayed JSON text

Step 2: Add JSON to Postman


  1. Open Postman app and select POST tab
  2. Change the POST route to  http://localhost:4000/import
  3. Click on Body tab
  4. Change type to raw and paste in the JSON

Step 3: Add Auth Bearer Token to Postman

  1. Open localhost Author session
  2. Open a survey
  3. Inspect session
  4. Goto Network tab and select All for filter
  5. Refresh session
  6. Select a graphql in left hand list
  7. Scroll down the right hand pane to Request Headers
  8. Copy just token part from authorization: Bearer <token>
  9. In Postman select the Authorzation tab
  10. Change Type to Bearer Token
  11. Paste in the <token>

Step 4: Importing schema

  1. In Postman Hit Send
  2. Select Home in the local Author session
  3. Open and check the imported questionnaire
Clone this wiki locally