POST Relations

The relation element is used to create a relation between two sections of your MBurger project. For example, you can use it to link an article to an author, a picture to a point of interest, a video to an event, etc

In this example we want to create a section with only one element of type relation called author-relation.

The relation field is populated with 2 sections ID: SECTION1_ID and SECTION2_ID.

POST /api/blocks/<SECTION_ID>/sections HTTP/1.1
Accept: application/json
X-MBurger-Token: <TOKEN>
X-MBurger-Version: <VERSION>
Content-Type: application/x-www-form-urlencoded; charset=utf-8



curl -X "POST" "/api/blocks/<SECTION_ID>/sections" \
     -H 'Accept: application/json' \
     -H 'X-MBurger-Token: <TOKEN>' \
     -H 'X-MBurger-Version: <VERSION>' \
     -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
     --data-urlencode "relation[0]=<SECTION1_ID>&relation[1]=<SECTION2_ID>"

Last updated