...
Code Block |
---|
curl -L -X POST 'https://dev.sunbirded.org/api/data/v1/page/section/create' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-authenticated-user-token: {{authToken}}' \
-H 'Authorization: Bearer {{api-key}}' \
--data-raw '{
"request": {
"name": "My State Trainings",
"dynamicFilters": "ignore",
"searchQuery": {
"request": {
"filters": {
"contentType": [
"Course"
],
"status": [
"Live"
],
"objectType": [
"Content"
]
},
"exists": [
"batches.batchId"
],
"sort_by": {
"me_averageRating": "desc",
"batches.startDate": "desc"
},
"limit": 10
}
},
"sectionDataType": "Content"
},
"display": {
"name": {
"en": "My State Trainings"
}
}
}' |
...
Code Block |
---|
curl -L -X PATCH 'https://dev.sunbirded.org/api/data/v1/page/update' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'x-authenticated-user-token: {{authToken}}' \ -H 'Authorization: Bearer {{api-key}}' \ --data-raw '{ "request":{ "name":"AnonymousCourseCourse", "id":"0126428196111728641"{{AnonymousCourseCourse PageID}}", "portalMap":[ { "id":"0129795542829875205",{{My State Trainings sectionId}}", "index":1, "group":1 }, { "id":"{{Featured Trainings Trainings sectionId}}", "index":"01228382681137152020",{{sectionId}}2, "group":2 }, { "id":"{{Latest Courses sectionId}}", "index":3, "group":3 }, { "id":"{{PopularCourses sectionId}}", "index":14, "group":24 } ], "appMap":[ { "id":"0129795542829875205",{{My State Trainings sectionId}} ", "index":1, "group":1 }, { "id":"{{Featured Trainings Trainings sectionId}}", "index":"01228382681137152020",{{sectionId}}2, "group":2 }, { "id":"{{Latest Courses sectionId}}", "index":13, "group":23 }, { "id":"{{PopularCourses sectionId}}", "index":4, "group":4 } ] } }' |
Similarly get the pages that needs to updated and update the pages with sections in the specified order.
...