Oct 30, 2016

Stack

The ‘master_locale’ key has been introduced.

Version 3 (New)Version 2

{

  "stack": {

    "name": "My New Stack",

    "description": "My new test stack",

    "master_locale": "en-us"

  }

}

{

  "stack": {

    "name": "My New Stack",

    "description": "My new test stack"

  }

}

Content Type

The request/response format has been changed. The default value of 'unique' field under 'schema' has been changed. The position of ‘description’ and ‘singleton’ keys have been changed.

Version 3 (New)Version 2

{

  "content_types": [

    {

     “title”:”Page”,

     ‘uid”:”page”

      ...

      "schema": [

        {

          "display_name": "Title",

          "uid": "title",

          "data_type": "text",

          "field_metadata": {

            "_default": true

          },

          "unique": false,

          "mandatory": true,

          "multiple": false

        }],

     "options": {      

         ...

         "singleton": false

      },

    "description": "Content_type Description"

  }

}

{

  "content_types": [

    {

     “title”:”Page”,

     ‘uid”:”page”

      ...

       "schema": [

        {

          "display_name": "Title",

          "uid": "title",

          "data_type": "text",

          "field_metadata": {

            "_default": true

          },

          "unique": "global",

          "mandatory": true,

          "multiple": false

        }],

      "options": {

        ...

        "description": "Content_type Description"

      },

      "singleton": false

    }

}

Entry

The ‘_metdata’ key has been removed from the ‘entry’ response body, and all they keys ('locale', 'uid', and 'publish_details') that were under ‘_metadata’ are now available directly under the ‘entry’ key.

Version 3 (New)Version 2

{

 ...

  "entry": {

   “title”:”example”,

   “url”:”/example”,

    "locale": "en-us",

    "uid": "abcdefhgi123",

    "publish_details": []

  }

}

{

  ...

  "entry": {

   “title”:”example”,

   “url”:”/example”

    "_metadata": {

      "locale": "en-us",

      "uid": "abcdefghi12345",

      "publish_details": []

   },

}

Entry published/unpublished

The environment name is now mentioned instead of its UID. ‘locale’ and ‘version’ keys have been made independant. Finally, the ‘content_type’ key has been eliminated.

Version 3 (New)Version 2

{

  "entry": {

    "locales": [

      "en-us"

    ],

    "environments": [

      "development"

    ]

  },

  "locale": "en-us",

  "version": 1

}

{

  "entry": {

    "content_type": {

      “title”:”Page”,

     “uid’:”page”

    },

    "entry": {

      "locale": "en-us",

      "version": "1"

    },

    "locale": [

      "en-us"

    ],

    "environment": [

      "qwertyuiop123456"

    ]

  }

}

Asset

The ‘_metadata’ object has been removed from the asset body, and the response data, ‘publish_details’, is now wrapped in the ‘asset’ object instead of the ‘upload’ object. The format of the 'url' key has been changed.

Version 3 (New)
Version 2

{

    "asset": {

      ...

      “uid”:”blt7b6c042533cdb1eb”,

      “filename”:”filename.jpg”,

      "url":"https://images.contentstack.io/v3/assets/
    {{api_key}}/{{asset_uid}}/{{unique_id}}/download",

      "publish_details": []

    }

}

{

    "upload": {

    ...

    “uid”:”blt7b6c042533cdb1eb”,

    “filename”:”filename.jpg”,

    "url":"https://api.contentstack.io/v2/uploads/
        {{unique_id}}/download?uid={{asset_uid}}",

      "_metadata": {

        ...

        "publish_details": []

     },

}

Asset published/unpublished

The asset details are now wrapped in the ‘asset’ object instead of the ‘entry’ object. The ‘entry’ and ‘action’ keys have been eliminated.

Version 3 (New)Version 2

{

  "asset": {

    "locales": [

      "en-us"

    ],

    "environments": [

      "development"

    ]

  }

}

{

  "entry": {

    "locale": [

      "en-us"

    ],

    "environment": [

      "1234567890abcdef"

    ],

    "entry": {

      “title”:”filename.jpg”,

       “entry_uid”:”blt7b6c042533cdb1eb”

    },

    "action": "action"

  }

}

Locales

The request/response format of the locale object has been changed from ‘locale_uid’ to ‘code’.

Version 3 (New)
Version 2

{

  "locale": {

    "code": "zh-cn"

  }

}

{

  "locale": {

    "locale_uid": "zh-cn"

  }

}

Environment

The ‘_metadata’ object removed from the environment response body and the ‘status’ key has been brought to the top level.

Version 3 (New)
Version 2

{

   "environment": {

      “uid”:”blt7b6c042533cdb1eb”,

     “name”:”development”, 

    "status": “1”

  },

}

{

 "environment": {

    “uid”:”blt7b6c042533cdb1eb”,

     “name”:”development”,

    "_metadata": {

      "status": “1”

     },

}

Publish Queue

The ‘form’ object has been replaced with ‘content_type’ and the ‘entry_uid’ key under the ‘entry’ object has been replaced with ‘uid’. The ‘_metadata’ object has been eliminated and all the keys (i.e., publish_details, user, roles, and cancelled_by) within it has become independent objects. The ‘status’ key has been included under the ‘publish_details’ object.

Version 3 (New)
Version 2

{

  "queue": [

    {

      ...

      "content_type": {

        "title": "Title",

        "uid": "uid"

      },

     ...

      "publish_details": {

        "status": 2,

        "user": "sys_bltd0f5afe8abcd",

        "roles": []

      },

      ...

    }

  ]

}

{

  "queue": [

    {

      “uid”:”abcd123”

      "form": {

        “title”:”form title”,

        “form_uid”:”uid”

      },

     ...

      "entry": {

        “locale”:”en-us”,

       “title”:”title of entry”

        "entry_uid": "abcdefhgi1234567890"

      },

    ...

      "_metadata": {

        "publish_details": [

          {

            "name": "server-name",

            "status": "-1",

            "message": ""

          }

        ],

        "user": "abcd1234567890",

        "roles": []

      },

      ...

    }

  ]

}

Audit Logs

The ‘_metadata’ object has been renamed to ‘metadata’ from audit log body.

Version 3 (New)
Version 2

{

  "logs": [{

    ...

    “event_type”:”create”,

    “module”:”entry”,

    "metadata": {

      "title": "Test",

      "locale": {

        "title": "English - United States"  ,

        "code": "en-us",

      }

      "content_type": {

        "title": "Page",

        "uid": "page",

      }

    }

  }]

}

{

  "logs": [{

    ...

    “event_type”:”create”,

    “module”:”entry”,

    "_metadata": {

      "title": "Test",

      "locale": {

        "title": "English - United States",

        "uid": "en-us",

      }

      "content_type": {

        "title": "Page",

        "uid": "page", 

      }

    }

  }]

}

Roles

The ‘rights’ object has been renamed to ‘permission’ and the ‘locales’ object has been added.

Version 3 (New)
Version 2

{

  “role”:{

    “uid”:”abcd1323”

    ...

    "permissions": {

      "content_types": [{

        "uid": "content_type_uid",

        “name”:”content_type_name”,

        "SYS_ACL": {

          "sub_acl": {}

        }

      }],

      "environments": [

        {   

          "uid": "environment_uid",

          "SYS_ACL": {

            "sub_acl": {}

          }

        }

      ],

      "locales": [

        {

           "uid": "locale_uid",

            "SYS_ACL": {

            "sub_acl": {}

          } ...

        } ]

      }

    }

  }

}

{

  “role”:{

    “uid”:”abcd1323”

    ...

    "rights": {

      "content_types": [{

        "uid": "content_type_uid",

        “name”:”content_type_name”,

        "SYS_ACL": {

          "sub_acl": {}

        }

      }],

      "environments": [

      {   

        "uid": "environment_uid",

        "SYS_ACL": {

          "sub_acl": {}

      }

    }]

    }

  }

}

Webhook

Three new calls, ‘execution’, ‘logs’, and ‘retry’, have been incorporated in the new release.

Webhook Request

The ‘webhook’ request object has been modified to include ‘basic_auth’ and ‘custom_header’ subkeys. The ‘url’ key has been renamed to ‘target_url’ and is now included under the ‘destinations’ key. Finally, we have added the ‘retry_policy’ key which will enable the user to manually trigger a webhook.

Version 3 (New)Version 2

{

  "webhook": {

    "name": "Test",

    "destinations": [

    {

      "target_url": "http://example.com",

      "http_basic_auth": "basic",

      "http_basic_password": "test",

      "custom_header": [

      {

        "header_name": "Custom-Header",

        "value": "testing"

      }]

    }],

    "channels": [

      "content_types.entries.create"

    ],

    "retry_policy": "manual"

  }

}

{

  "webhook": {

    "name": "Test",

    "url": "http://example.com",

    "channels": [

      "content_types.entries.create"

    ]

  }

}

Webhook Trigger Response

The trigger response body has been modified. The changes are illustrated in the following examples:

Publishing Entries:

Version 3 (New)Version 2

{

    "event": "publish",

    "data": {

        "content_type": {

            "options": {

            ...

                "singleton": false

            },

             "schema": [{

                "multiple": false,

                "mandatory": true,

                "unique": false,

                "field_metadata": {

                    "_default": true

                },

                "data_type": "text",

                "uid": "title",

                "display_name": "Title"

            }],

             "description": "Description"

            "uid": "content_type_uid",

            "title": "content_type_title"

        },

        "entry": {

            "publish_details": [{

            ...

                "locale": "en-us",

                "environment": "aabcdf9733d7045cde5"

            }],

            "title": "example",

            "url": "/example"

        },

        "environment": {

            "uid": "babcd9ff9733d7045cde5",

            "name": "environment_name"

        }

    },

    "api_key": "abcdc820784d36d152f",

    "module": "entry"

}


{

    "event": "publish.success",

    "data": {

        "form": {

            "singleton": false,

            "options": {

            ...

                "description": "Description"

            },

            "schema": [{

                "multiple": false,

                "mandatory": true,

                "unique": "global",

                "field_metadata": {

                    "_default": true

                },

                "data_type": "text",

                "uid": "title",

                "display_name": "Title"

            }],

            "uid": "content_type_uid",

            "title": "content_type_title"

        },

        "entry": {

            "_metadata": {

                "publish_details": [{

            ...

                    "locale": "en-us",

                    "environment": "aabcdf9733d7045cde5"

                }]

            },

            "title": "example",

            "url": "/example"

        },

        "environment": {

            "uid": "babcd9ff9733d7045cde5",

            "name": "environment_name"

        }

    },

    "api_key": "abcdc820784d36d152f",

    "module": "entry"

}

Publishing Assets:

Version 3 (New)Version 2

{

    "event": "publish",

    "data": {

        "asset": {

    ...

            "publish_details": [{

    ...

                "locale": "en-us",

                "environment": "bdffff9733d7045cde5"

            }],

            "filename": "test.png"

        },

        "environment": {

            "uid": "bldgs733d7045cde5",

            "name": "environment_name"

        }

    },

    "api_key": "abcd820784d36d152f",

    "module": "asset"

}

{

    "event": "publish.success",

    "data": {

        "upload": {

    ...

            "_metadata": {

                "publish_details": [{

    ...

                    "locale": "en-us",

                    "environment": "bdffff9733d7045cde5"

                }]

            },

            "filename": "test.png"

        },

        "environment": {

            "uid": "bldgs733d7045cde5",

            "name": "environment_name"

        }

    },

    "api_key": "abcd820784d36d152f",

    "module": "asset"

}

Was this article helpful?

Thanks for your feedbackSmile-icon

^