Skip to content
Ford edited this page Aug 28, 2013 · 5 revisions

============= The SecondFunnel project provides an API for accessing the data. The API can be accessed by any logged in user or user with an API key, however, data can only be modified by staff of the store whose data is being accessed or a superuser.

On resources where filtering is enabled; filtering takes place by weeding out all the content that does not match the conditions of the query; e.g. a query on products with store id = 28, will only return products whose store has id #28.

Resource List

Return Status

  • 200 OK: The request went through successfully.
  • 400 UNAUTHORIZED: Attempted to access a resource you don't have permission to access or attempted to POST/PUT/PATCH a resource using an API key.
  • 400 BAD REQUEST: Request was malformed.
  • 400 NOT IMPLEMENTED: Resource doesn't support the type of operation (e.g. POST, PUT, PATCH, etc.)
  • 500 INTERNAL SERVER ERROR: Something went wrong on the server side.

Specification

####GET /api/assets/v1/block_content Returns all BlockContent objects. No Authentication needed.

Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist

####GET/POST/PATCH/DELETE [/api/assets/v1/store](http://secondfunnel.com/api/assets/v1/store) Returns all Store objects. Optionally filtered by a query. Authentication required (ApiKeyAuthentication not supported).
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
id no 1 id of the store (natural number)
name no 1 name of the store (valid string)

####GET/POST/PATCH/DELETE [/api/assets/v1/product](http://secondfunnel.com/api/assets/v1/product) Returns all Product objects. Optionally filtered by a query. Authentication required (ApiKeyAuthentication not supported).
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
store no 1 id of a store (natural number)
id no 1 id of the product (natural number)
name no 1 name of the product (valid string)
name_or_url no 1 string that may appear in the name or url
available no 1 boolean

####GET/POST/PATCH/DELETE [/api/assets/v1/product_media](http://secondfunnel.com/api/assets/v1/product_media) Returns all ProductMedia objects. Optionally filtered by a query. Authentication required (ApiKeyAuthentication not supported).
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
product no 1 id of a product (natural number)

####GET/POST/PATCH/DELETE [/api/assets/v1/store_theme](http://secondfunnel.com/api/assets/v1/store_theme) Returns all Store Themes. Optionally filtered by a query. Authentication required.

Additional urls:

/api/assets/v1/store_theme/store/STORE_NAME_OR_ID/

Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
api_key yes 1 the api key
username yes 1 username associated with api key
store no 1 id of a store (natural number)
store_name no 1 name of a store (valid string)
name no 1 a string in the name of the theme

####GET/POST/PATCH/DELETE [/api/assets/v1/campaign](http://secondfunnel.com/api/assets/v1/campaign) Returns all Campaign objects. Optionally filtered by a query. Authentication required.

Additional URLs:

/api/assets/v1/campaign/CAMPAIGN_NAME

/api/assets/v1/campaign/store/STORE_ID

Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
api_key yes 1 the api key
username yes 1 username associated with api key
live no 1 boolean
store no 1 name of store or id of store

####GET [/api/assets/v1/youtube_video](http://secondfunnel.com/api/assets/v1/youtube_video) Returns all YoutubeVideo resources. Optionally filtered by a query. Authentication required (ApiKeyAuthentication not supported).
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
id no 1 id of the youtube video (natural number)

####GET [/api/assets/v1/generic_image](http://secondfunnel.com/api/assets/v1/generic_image) Returns all GenericImages. Optionally filtered by a query. Authentication required (ApiKeyAuthentication not supported). **Deprecated**: We're moving away from using the GenericImage resource.
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
id no 1 id of the generic image (natural number)

####GET/POST/PATCH/DELETE [/api/assets/external_content_type](http://secondfunnel.com/api/assets/v1/external_content_type) Returns all ExternalContentTypes. Authentication required (ApiKeyAuthentication not supported).
Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist

####GET/POST/PATCH/DELETE [/api/assets/external_content](http://secondfunnel.com/api/assets/v1/external_content) Returns all External Content. Optionally filtered by a query. Authentication required.

Additional URLs

/api/assets/v1/external_content/store/STORE_NAME_OR_ID

Query Required Number of Parameters Parameters
format yes 1 one of: json, xml, yaml, jsonp, html, plist
api_key yes 1 the api key
username yes 1 username associated with api key
type_name no 1 the type of content (Instagram, Facebook,etc.)
store_name no 1 the name of the store (a valid string)
text no 1 a valid string
tags_name no Any a list of tagged product names
tags_id no Any a list of tagged product ids
original_url no 1 a string in the content's url
date no 1 a valid date range (e.g. 2013-2014)

Clone this wiki locally