Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formats endpoint docs #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,76 @@ Returns user permission to given project.
"role": "writer"
}

### Get User Custom Formats [GET /users/{user_id}/formats/{format_id}]
Returns user custom formats.

**OAuth2 Scope:** user.formats.read

+ Parameters

+ user_id (string) - ID of a user.
+ format_id (string) - ID of a custom format.

+ Response 200

+ Attributes
+ user_id (string) - ID of the user the format relates to.
+ url (string) - Link to feed that format is based on.
+ name (string) - Name of the format.
+ extension (string) - Formats extension (xml, csv..).
+ visibility (boolean) - X
+ country (string) - Formats country.
+ mappings - List of FormatMappings.
+ format_id (string) - Format id.
+ xpath (string) - Xpath of given element.
+ target (string) - Mergado target for given element.
+ type (string) - Format mappings type.
+ parent (string) - Xpath of elements parent.
+ is_wrapper (boolean) - Tells us if the element wraps other elements.
+ order (string) - Order of given element.

+ Headers

Content-Type: application/json

+ Body

{
'user_id': '1',
'url': 'https://host.cz/feed.xml',
'name': 'custom1',
'extension': 'xml',
'visibility': False,
'country': 'cz',
'mappings': [
{
'format_id': '1',
'xpath': '/ROOT',
'target': 'CHANNEL',
'type': 'keep',
'parent': None,
'is_wrapper': True,
'order': 1
},
{
'format_id': '1',
'xpath': '/ROOT/ITEM',
'target': 'ITEM',
'type': 'keep',
'parent': '/ROOT',
'is_wrapper': True,
'order': 2}
},
{
'format_id': '1',
'xpath': '/ROOT/ITEM/ITEM_ID',
'target': 'ITEM_ID',
'type': 'keep',
'parent': '/ROOT/ITEM',
'is_wrapper': False,
'order': 3}
}]
}

## Eshops [/users/{id}/shops/{?limit,offset,fields,filter}]
Eshops in Mergado.
Expand Down