SparkLoop
  • API v2
    • Endpoints
      • Subscribers
        • Events
      • Referral Campaigns
        • Campaign Memberships
        • Subscribers
      • Partner Profile
        • Recommendations
        • Payouts
      • Publications
      • Upscribe
        • Recommendations
      • Partner Programs
      • Partner Network
        • Publications
        • Partner Programs
      • Webhooks
    • Schemas
      • Partner Profile Object
      • Partner Program Object
      • Publication Object
      • Subscriber Object
      • Campaign Object
      • Upscribe Object
      • Recommendation Object
    • Guides
      • How to use Upscribe via API
  • API v1
    • Campaigns
    • Subscribers
    • Events
    • Webhooks
  • Webhooks
  • Changelog
Powered by GitBook
On this page
  • Create a subscriber
  • Get subscribers
  • Get a subscriber
  • Update subscriber
  • Unsubscribe subscriber
  • Reject subscriber

Was this helpful?

  1. API v2
  2. Endpoints

Subscribers

Create a subscriber

POST https://api.sparkloop.app/v2/subscribers

Request Body

Name
Type
Description

email*

string

Email

name

string

Name

referrer_code

string

The referral code of the person who referred this subscriber. If Joanne with ref_code joanne123 referred this subscriber, you should set this value to joanne123

ip_address

string

IP Address

user_agent

string

User Agent

utm_source

string

UTM Source

utm_campaign

string

UTM Campaign

created_at

string

Timestamp when subscriber signed up. You can set this value to a date in the past. Expected format: YYYY-MM-DDThh:mm:ssTZD e.g. 2021-03-22T19:20:30+01:00 Where: YYYY = four-digit year MM = two-digit month (01=January, etc.) DD = two-digit day of month (01 through 31) hh = two digits of hour (00 through 23) mm = two digits of minute (00 through 59) ss = two digits of second (00 through 59) s = one or more digits representing a decimal fraction of a second TZD = time zone designator (Z or +hh:mm or -hh:mm)

country_code

string

Alpha-2 ountry code of the subscriber

{
    "subscriber": <Subscriber Object>
}
{
    "error": "Email has already been taken"
}
{
    "error": "Email is invalid"
}
{
    "error": "You have to provide at least an email"
}

Get subscribers

GET https://api.sparkloop.app/v2/subscribers

Subscribers are ordered in desceding order by created_at, meaning the first page shows the latest subscribers.

Query Parameters

Name
Type
Description

type

string

Type of subscribers you want to get. Default is all, allowed values are all, referrals, advocates.

expand

string

If you pass "campaigns" the response will include referral_programs data

{
  "subscribers": [
    <Subscriber Object>,
    <Subscriber Object>,
    <Subscriber Object>,
  ],
  "meta": {
    "per_page": 2,
    "page": 2,
    "total_pages": 3,
    "total_subscribers": 6
  }
}

Get a subscriber

GET https://api.sparkloop.app/v2/subscribers/:identifier

Returns a single subscriber by email address or UUID

Path Parameters

Name
Type
Description

identifier*

string

Subscriber's UUID or email address

Query Parameters

Name
Type
Description

expand

String

If you pass "campaigns" the response will include referral_programs data

{
  "subscriber": <Subscriber Object>
}
{
    "error": "Subscriber sub_4bc10562d97 not found!"
}

Update subscriber

PUT https://api.sparkloop.app/v2/subscribers/:identifier

Update a subscriber's name, email address or status

Path Parameters

Name
Type
Description

identifier*

string

Subscriber's UUID or email address

Request Body

Name
Type
Description

status

string

Subscriber's status. Allowed values are unsubscribed and confirmed.

name

string

Subscriber's name.

email

string

Subscriber's email address.

{
    "subscriber": <Subscriber Object>
}
{
    "error": "Invalid status!"
}
{
    "error": "You have to update at least 1 field."
}

Unsubscribe subscriber

PUT https://api.sparkloop.app/v2/subscribers/:identifier/unsubscribe

Unsubscribe a subscriber

Path Parameters

Name
Type
Description

identifier*

string

Subscriber's UUID or email address

{
    "subscriber": <Subscriber Object>
}

Subscriber is not pending

{
    "error": "Subscriber subscriber_fsd62dr6 has already been unsubscribed"
}

Reject subscriber

PUT https://api.sparkloop.app/v2/subscribers/:identifier/reject

Reject a pending subscriber (acquired via partner program or referral program)

Path Parameters

Name
Type
Description

identifier*

string

Subscriber's UUID or email address

{
    "subscriber": <Subscriber Object>
}

Subscriber is not pending

{
    "error": "Subscriber subscriber_fsd62dr6 must be pending"
}

PreviousEndpointsNextEvents

Last updated 6 months ago

Was this helpful?