This document describes the steps to follow to backup content data from an environment using postman and APIs.
Table of Content Zone | ||||||||
---|---|---|---|---|---|---|---|---|
|
Prerequisites
Postman application.
Schema keynames
Login API
Status | ||||
---|---|---|---|---|
|
...
Code Block |
---|
{ "success": true, "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9" } |
Steps to follow
Log in to the environment using Login API
{{url}}/api/login
withMethod: POST
.Select body > raw > JSON and use the admin’s username and password in the request body.
Under the header tab, use the Key-Value pair
Content-Type: application/json
and click “Send”You will receive a
token
in the response body.Copy the token for later use. We recommend using the environment variables to store frequently used data.
Back up the Content data Using API
Status | ||||
---|---|---|---|---|
|
...
Code Block |
---|
{ "result": [ { "state": { "mode": "edit", "req": "" }, "projectId": [ "5cf9249637e124a03087780b" ], "itemName": "Hospital 2", "_id": "60a3ea26e393580082fa18f1", "hospitalname": "American Red Cross", "city": "Davenport", "location": { "lat": 25.978889, "lon": -80.282501 }, "createdAt": "2021-05-18T16:24:06.169Z", "createdBy": { "_id": "58c0587dc01db80f00191683", "firstName": "Orbita", "lastName": "Health", "locked": false, "inactive": false, "isLocked": false, "id": "58c0587dc01db80f00191683" }, "user": "58c0587dc01db80f00191683", "modifiedAt": "2021-05-28T13:08:46.434Z", "__v": 0 }, { "state": { "mode": "edit", "req": "" }, "projectId": [ "5cf9249637e124a03087780b" ], "itemName": "Hospital1", "_id": "609e95d5e393580082fa128f", "hospitalname": "Children's Hospital", "city": "Davenport", "location": { "lat": 40.745255, "lon": -74.034775 }, "createdAt": "2021-05-14T15:23:01.113Z", "createdBy": { "_id": "58c0587dc01db80f00191683", "firstName": "Orbita", "lastName": "Health", "locked": false, "inactive": false, "isLocked": false, "id": "58c0587dc01db80f00191683" }, "user": "58c0587dc01db80f00191683", "modifiedAt": "2021-05-18T16:22:32.730Z", "__v": 0 } ], "paging": { "pageCount": 1, "currentPage": 1, "itemCount": 2, "resultsCount": 2, "hasMore": { "hasPrevious": false, "hasNext": false } } } |
Steps to follow
Use the Content search API along with the projected param with
Method: PATCH
{{url}}/api/schema/content/facilitydata/data?projectId=5cf9249637e124a03087780b
In the Header tab, use the following the Key-Value pairs
Content-Type: application/json
Authorization: Bearer {{token}}
Set the request body to raw > JSON > add the request query and click “Send”.
You will receive a response. Save the response body.
For each schema, the number of documents retrieved from the API should be split into smaller chunks.
You have to hit the API multiple times to get all the content data.
Related
...
Articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|