keboola/magento-extractor-bundle

此包已被废弃且不再维护。未建议替代包。
此包最新版本(0.0.2)没有提供许可证信息。

一些新组件

安装: 25

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 8

分支: 1

开放问题: 0

类型:symfony-bundle

0.0.2 2015-05-05 19:24 UTC

This package is not auto-updated.

Last update: 2019-02-20 19:29:44 UTC


README

FORMAT: 1A HOST: https://syrup.keboola.com/ex-fb-ads

Magento Extractor 配置

身份验证

在 /oauth 端点上使用 POST/GET 必须包含 tokenconfig 参数,其中 config 是特定配置的表名(必须已存在)。在请求身份验证之前,该配置表必须设置 api_urloauth.consumer_secretoauth.consumer_key 属性。

配置表

属性

  • api_url:您应用程序的基本 URL - 例如,在 Magento 文档 中的 http://magentohost,例如 http://yourapplication.com(不包含 /api/rest
  • oauth.consumer_key:在 Magento 管理界面生成的消费者密钥 - 请参阅 管理文档
  • oauth.consumer_secret:以与 oauth.consumer_key 相同的方式获得的消费者密钥

/oauth 端点生成的剩余必要 OAuth 信息

数据

    • endpoint(必需):API 端点
    • params:API 调用的查询参数,JSON 编码
      • JSON 编码对象中的每个参数可以包含一个字符串,例如:{""key"": ""value""}
      • 可以通过设置两个参数来配置 过滤器,如下例所示
        • "filter[0][attribute]":"created_at"
        • "filter[0][gt]":"2014-12-09 22:02:53"
      • 支持使用包含来自 sys.c-ex-magento-metadata.{config} 表的数据的元数据支持用户函数 用户函数(请参阅以下示例数据)
    • dataType:端点返回的数据类型。它还描述了将结果存储的表名
    • dataField:允许覆盖将导出响应的哪个字段。仅与 data API 一起使用
      • 如果响应中有多个数组在 "root" 中,提取器可能不知道要导出哪个数组,并失败
      • 如果响应是数组,默认情况下将使用整个响应
      • 如果没有在 "root" 中找到数组,必须在 dataField 中指定响应数据的路径
      • 可以包含到嵌套值的路径,点分隔符(例如 result.results.products
    • rowId(必需):配置行的唯一标识符

示例数据

"endpoint","params","dataType","dataField","recursionParams","rowId"
"orders","{
""limit"":100,
""filter[0][attribute]"":""created_at"",
""filter[0][gt]"":{
    ""function"": ""date"",
    ""args"": [
      ""Y-m-d H:i:s"",
      {
        ""function"": ""strtotime"",
        ""args"": [{""metadata"":""jobs.lastStart.orders""}]
      }
    ]
  }
}","","","","orders"
"customers","{""limit"":100}","","","","customers"

分组API

提取器运行 [/run]

运行提取 [POST]

JSON参数

  • config (必需) ... 配置ID(配置表名称)
  • 请求 (application/json)

    • 头部信息

        Accept: application/json
        X-StorageApi-Token: Your-Sapi-Token
      
    • 正文

        {
            "config": "main"
        }
      
    • 模式

        {
            "type": "object",
            "required": true,
            "properties": {
                "config": {
                    "type": "string",
                    "required": true
                }
            }
        }
      
  • 响应 201 (application/json)

      {
          "id": "48419532",
          "url": "https://syrup.keboola.com/queue/job/48419532",
          "status": "waiting"
      }
    

生成OAuth令牌 [/oauth{?token,config}]

从Web表单/UI生成令牌 [POST]

  • 参数

    • token = `` (必需, 字符串, 305-78945-rg48re4g86g48gwgr48e6) ... 您的KBC令牌

    • config = `` (必需, 字符串, main) ... 配置表名称/配置ID

  • 请求 (multipart/form-data; boundary=----WebKitFormBoundaryC5GD12ZfR1D8yZIt)

    • 正文

        ------WebKitFormBoundaryC5GD12ZfR1D8yZIt
        Content-Disposition: form-data; name="token"
      
        305-78954-d54f6ew4f84ew6f48ewq4f684q
        ------WebKitFormBoundaryC5GD12ZfR1D8yZIt--
      
        ------WebKitFormBoundaryC5GD12ZfR1D8yZIt
        Content-Disposition: form-data; name="config"
      
        main
        ------WebKitFormBoundaryC5GD12ZfR1D8yZIt--
      
    • 模式

        {
            "type": "object",
            "required": true,
            "properties": {
                "config": {
                    "type": "string",
                    "required": true
                }
                "token": {
                    "type": "string",
                    "required": true
                }
            }
        }
      
  • 响应 201 (application/json)

      {
          "status": "ok"
      }
    

手动生成令牌 [GET]

  • 参数

    • token = `` (必需, 字符串, 305-78945-rg48re4g86g48gwgr48e6) ... 您的KBC令牌

    • config = `` (必需, 字符串, main) ... 配置表名称/配置ID

  • 响应 201 (application/json)

      {
          "status": "ok",
          "oauth_token": "dsjioafhoiy832yt598y7895y",
          "oauth_token_secret": "kf98v0894u8j580jy8902xyjciurewc"
      }