keboola / magento-extractor-bundle
Some new component
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- guzzlehttp/oauth-subscriber: 0.1.*
- keboola/codebuilder: ~0.1.0
- keboola/extractor-bundle: 2.0.*@dev
Requires (Dev)
- phpunit/phpunit: 3.7.*
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 configuration
Authentication
POST/GET on /oauth endpoint
Must contain token and config parameters, where config is a table(must already exist) name of the particular configuration.
The config table must have api_url
, oauth.consumer_secret
and oauth.consumer_key
attributes set prior to requesting the authentication.
Config table
Attributes
- api_url: The base URL of your application -
http://magentohost
in the Magento documentation, eg. http://yourapplication.com (without /api/rest) - oauth.consumer_key: Consumer key generated in Magento Admin UI - see Admin documentation
- oauth.consumer_secret: Consumer secret obtained in the same fashion as oauth.consumer_key
Remaining necessary OAuth information generated by /oauth endpoint
Data
- Columns:
- endpoint(required): The API endpoint
- params: Query parameters of the api call, JSON encoded
- Each parameter in the JSON encoded object may either contain a string, eg:
{""key"": ""value""}
- Filters can be configured by setting two parameters as seen in the example below:
"filter[0][attribute]":"created_at"
"filter[0][gt]":"2014-12-09 22:02:53"
- User functions are supported with metadata containing data from sys.c-ex-magento-metadata.{config} table (see the example data below)
- Each parameter in the JSON encoded object may either contain a string, eg:
- dataType: Type of data returned by the endpoint. It also describes a table name, where the results will be stored
- dataField: Allows to override which field of the response will be exported. Only used with data API
- If there's multiple arrays in the response "root" the extractor may not know which array to export and fail
- If the response is an array, the whole response is used by default
- If there's no array within the root, the path to response data must be specified in dataField
- Can contain a path to nested value, dot separater (eg
result.results.products
)
- rowId(required): An unique identificator of the configuration row
Example data
"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"
Group API
Extractor run [/run]
Run extraction [POST]
JSON Parameters:
- config (required) ... configuration id (name of configuration table)
-
Request (application/json)
-
Headers
Accept: application/json X-StorageApi-Token: Your-Sapi-Token
-
Body
{ "config": "main" }
-
Schema
{ "type": "object", "required": true, "properties": { "config": { "type": "string", "required": true } } }
-
-
Response 201 (application/json)
{ "id": "48419532", "url": "https://syrup.keboola.com/queue/job/48419532", "status": "waiting" }
Generate OAuth token [/oauth{?token,config}]
Generate token from a web form/UI [POST]
-
Parameters
-
token = `` (required, string,
305-78945-rg48re4g86g48gwgr48e6
) ... Your KBC Token -
config = `` (required, string,
main
) ... Config table name / configuration ID
-
-
Request (multipart/form-data; boundary=----WebKitFormBoundaryC5GD12ZfR1D8yZIt)
-
Body
------WebKitFormBoundaryC5GD12ZfR1D8yZIt Content-Disposition: form-data; name="token" 305-78954-d54f6ew4f84ew6f48ewq4f684q ------WebKitFormBoundaryC5GD12ZfR1D8yZIt-- ------WebKitFormBoundaryC5GD12ZfR1D8yZIt Content-Disposition: form-data; name="config" main ------WebKitFormBoundaryC5GD12ZfR1D8yZIt--
-
Schema
{ "type": "object", "required": true, "properties": { "config": { "type": "string", "required": true } "token": { "type": "string", "required": true } } }
-
-
Response 201 (application/json)
{ "status": "ok" }
Generate token manually [GET]
-
Parameters
-
token = `` (required, string,
305-78945-rg48re4g86g48gwgr48e6
) ... Your KBC Token -
config = `` (required, string,
main
) ... Config table name / configuration ID
-
-
Response 201 (application/json)
{ "status": "ok", "oauth_token": "dsjioafhoiy832yt598y7895y", "oauth_token_secret": "kf98v0894u8j580jy8902xyjciurewc" }