Introduction
Welcome to the Marketfox API! You can use our API to access and manage your marketfox account and build applications on top of it.
We have language bindings in multiple languages. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
If you find any API’s to be missing. Please get in touch with us at support@marketfox.io
Authentication
To authorize, use this code:
# With shell, you can just pass the correct header with each request
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X GET "api endpoint here"
Make sure to replace
<apikey>and<sitekey>with respective values.
Marketfox uses API keys to allow access to the API. You can get your API key on your Marketfox profile.
Marketfox expects for the API key and Domain key to be included in all API requests to the server in a header that looks like the following:
Authorization: apikey:domainkey
Ping
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X GET https://api.marketfox.io/api/v1/ping
The above command returns JSON structured like this:
{
"message":"pong"
}
You can verify your authentication credentials by hitting this end point
HTTP Request
GET https://api.marketfox.io/api/v1/ping
Customers
Create or Update Customer
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-d '{"customer":{"email":"john@doe.com","first_name":"John", "last_name": "Doe"}}'
-X POST https://api.marketfox.io/api/v1/customers
The above command returns JSON structured like this:
{
"id":1,
"first_name":"John",
"last_name":"Doe",
"alias":null,
"email":"john@doe.com",
.......
}
This endpoint helps to create or update customer
HTTP Request
POST https://api.marketfox.io/api/v1/customers
Customer attributes and Custom fields can be passed as customer parameters to update the customer
Additional Customer Attributes
| Attribute | Example | Description |
|---|---|---|
| tags | “tag1,tag2” | Add specific tags to the customers |
| avatar_url | http://yourwebsite.com/user.jpg | Pass in a image url for the customer avatar to be set. |
Get Customer
Replace
<customer_id>with respective value.
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X Get https://api.marketfox.io/api/v1/customers/<customer_id>
The above command returns JSON structured like this:
{
"id":1,
"first_name":"John",
"last_name":"Doe",
"alias":null,
"email":"john@doe.com",
.......
}
This endpoint helps to get information of a customer
HTTP Request
GET https://api.marketfox.io/api/v1/customers/:customer_id:
Update Customer
Replace
<customer_id>with respective value.
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-d '{"customer":{"email":"john@doe.com","first_name":"John", "last_name": "Doe"}}'
-X POST https://api.marketfox.io/api/v1/customers/<customer_id>
The above command returns JSON structured like this:
{
"id":1,
"first_name":"John",
"last_name":"Doe",
"alias":null,
"email":"john@doe.com",
.......
}
This endpoint helps to create or update customers
HTTP Request
POST https://api.marketfox.io/api/v1/customers/:customer_id:
Customer attributes and Custom fields can be passed as customer parameters to update the customer
Additional Customer Attributes
| Attribute | Example | Description |
|---|---|---|
| tags | “tag1,tag2” | Add specific tags to the customers |
| avatar_url | http://yourwebsite.com/user.jpg | Pass in a image url for the customer avatar to be set. |
Create Customer Event
Replace
<customer_id>with respective value.
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-d '{"event":{"name":"button click","value":"demo"}}'
-X POST https://api.marketfox.io/api/v1/customers/<customer_id>/event
The above command returns JSON structured like this:
{
"success":true
}
This endpoint helps to create a customer event
HTTP Request
POST https://api.marketfox.io/api/v1/customers/:customer_id:/event
Event Parameters
| Parameter | Sample Value | Description |
|---|---|---|
| name | “button click” | give a name to the event you want to track |
| value | “demo” | give a value or pass "" if value is empty |
Get All Customers
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X GET https://api.marketfox.io/api/v1/customers
The above command returns JSON structured like this:
[
{
"id":2,
"first_name":"Jane",
"last_name":"Doe",
"alias":null,
"email":"jane@doe.com",
.......
},
{
"id":1,
"first_name":"John",
"last_name":"Doe",
"alias":null,
"email":"john@doe.com",
.......
}
]
This endpoint helps to retrieve all the customers in Marketfox.
HTTP Request
GET https://api.marketfox.io/api/v1/customers
Query Parameters
| Parameter | Value | Description |
|---|---|---|
| before | customer_id | returns customers before the mentioned customer id. |
| after | customer_id | returns customers after the mentioned customer id. |
Search Customers
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X GET https://api.marketfox.io/api/v1/customers/filter?email=john@doe.com
The above command returns JSON structured like this:
{
"id":1,
"first_name":"John",
"last_name":"Doe",
"alias":null,
"email":"john@doe.com",
.......
}
This endpoint helps to search customers using email.
HTTP Request
GET https://api.marketfox.io/api/v1/customers/filter?email=:email:
Query Parameters
| Parameter | Value | Description |
|---|---|---|
| sample@yourwebsite.com | Mandatory param for the request. |
Articles
Get Latest Articles
curl -i -H "Content-Type:application/json"
-H "Authorization: apikey:domainkey"
-X GET https://api.marketfox.io/api/v1/articles
The above command returns JSON structured like this:
[
{
"id":2,
"title":"My Awesome blog post 2",
"description":"My Awesome blog post 2 content",
"text_description":"My Awesome blog post 2 description",
"category":"category2",
"folder":"folder2",
"published_at":"2017-02-11T19:21:27.000Z",
"slug":"awesome_blog_post_2"
},
{
"id":1,
"title":"My Awesome blog post",
"description":"My Awesome blog post content",
"text_description":"My Awesome blog post description",
"category":"category1",
"folder":"folder1",
"published_at":"2017-01-14T09:21:20.000Z",
"slug":"awesome_blog_post_1"
}
]
This endpoint retrieves the recent blog articles
HTTP Request
GET https://api.marketfox.io/api/v1/articles