heimrichhannot/contao-privacy-api-bundle

此包作为 heimrichhannot/contao-privacy 和 heimrichhannot/contao-api-bundle 之间的桥梁,以提供隐私模块的 API。

1.2.1 2021-06-10 14:52 UTC

This package is auto-updated.

Last update: 2024-09-10 22:13:27 UTC


README

此包作为 heimrichhannot/contao-privacyheimrichhannot/contao-api-bundle 之间的桥梁,以提供隐私模块的 API。

安装

通过 composer 安装: composer require heimrichhannot/contao-privacy-api-bundle 并更新您的数据库。

功能

  • 提供两个与隐私相关的交互端点:同意和拒绝
  • 调用这些端点将在协议归档中生成协议条目(有关详细信息,请参阅 heimrichhannot/contao-privacy

使用方法

1. 安装后,按常规创建隐私协议归档(有关详细信息,请参阅 heimrichhannot/contao-privacy

2. 现在,导航到左侧的 contao 部分 "API" 中的 "Apps",并创建您的同意端点。以下图像提供了一个双步验证应用的示例

提示:拒绝以类似的方式完成。

alt preview

3. 之后,您可以使用以下 2 步进行同意

3.1. 按照在 heimrichhannot/contao-api-bundle 中描述的方式,向 http://example.org/api/login/user(如果您喜欢通过 Contao 成员进行身份验证,则为 http://example.org/api/login/member) 发送 POST 请求

curl --user user@:password -H "Content-Type: application/json" -X POST http://example.org/api/login/user

上述请求的响应包含您的身份验证令牌。使用此令牌调用您刚刚创建的 API 端点

curl --header "Authorization: Bearer <login-token>" -H "Content-Type: application/json" -X POST -d "{"gender":"male", "firstname":"John", "email":"john.doe@example.org"}" http://example.org/api/resource/privacy_protocol_entry_opt_in?key=<api_key>