Gank Logo
Essentials

Creator API

API for creator to handles creator-specific functionalities

Currently Gank have 2 subdomains which can be used for your integration, which are

  • referred by V1_API:
https://api.ganknow.com/
  • referred by V2_API:
https://api-v2.ganknow.com/

Although it is expected that creators only interact with the V2 API, which hosts the Creator API functionality, since the V1 API only hosts Gank-specific functionality used for our own Ganknow traffic

Auth API

Generate Creator API authentication. This will also revoke the previously-generated token validity

Sample request

curl -XPOST "${V2_API}/auth/creators" -H "Authorization: Bearer ${LOGIN_TOKEN}"

Sample response

{"token": "..."}

Register webhook

Register webhook URL that will be used to send updates from your Gank account to your custom URL. Please note that registering callback URL will invalidate previously registered URL, meaning the update will not be sent to the previous URL anymore.

Response will be a secret key that you can use to check the signature of the webhook payload

Sample request

curl -XPOST "${V2_API}/auth/external-callback/register" -H "Authorization: Bearer ${LOGIN_TOKEN}" --data '{
  "external_callback_url": "https://your-url.com/gank-webhook",
  "events": ["USER_MEMBERSHIP.TX_SUCCEED", "DIGITAL_GOODS.TX_SUCCEED"]
}'

Sample response

{
  "id": "...",
  "owner_user_id": "...",
  "key": "...",
  "external_callback_url": "https://",
  "events": [...]
}

Get registered webhook

Get the previously-registered webhook data

Sample request

curl -XGET "${V2_API}/auth/external-callback/register" -H "Authorization: Bearer ${LOGIN_TOKEN}"

Sample response

{
  "id": "...",
  "owner_user_id": "...",
  "key": "...",
  "external_callback_url": "https://",
  "events": [...]
}

Edit registered webhook

Change what events will be sent to your registered custom URL

Sample request

curl -XPATCH "${V2_API}/auth/external-callback/register/events" -H "Authorization: Bearer ${LOGIN_TOKEN}" --data '{
  "events": ["USER_MEMBERSHIP.TX_SUCCEED", "DIGITAL_GOODS.TX_SUCCEED"]
}'

List subscribers

Lists Gank user which subscribes to one of your membership

Sample request

curl -XGET "${V2_API}/payment/creator/subscribers" -H "Authorization: Bearer ${CREATOR_TOKEN}"

active Whether the subscriber currently has active subscription or not

search_nickname_exact Returns subscribers with exact nickname matched

search_nickname_pattern Returns subscribers with nickname matching LIKE pattern (LIKE '%{nickname}%')

search_case_sensitive Whether to use case-sensitivity or not for subscribers search

membership_setting_id Returns susbcribers that subscribes to a membership_setting_id

page Pagination

per_page Pagination

Sample response

{
    "data": [
        {
            "supporter_user_id": "{user_id}",
            "supporter_nickname": "...",
            "supporter_avatar": null,
            "membership_setting_id": "...",
            "subscription_start": "...",
            "subscription_end": "...",
            "subscription_type_latest": "RECURRING",
            "subscription_period": 1,
            "latest_membership_detail_id": "{membership_detail_id}",
            "latest_membership_detail_month": 1
        }
    ],
    "total": 1
}

Get subscription status

Get the subscription status of a subscription

Sample request

curl -XGET "${V2_API}/payment/creator/subscription/{id}/status" -H "Authorization: Bearer ${CREATOR_TOKEN}"

id The payment ID

Sample response

{
    "active": true
}

Export list of subscribers

Lists Gank user which subscribes to one of your membership. Use this instead of List subscribers API if you want to get a large amount of data at once, since this does not need large pagination which slows down the query

Sample request

curl -XGET "${V2_API}/payment/creator/subscribers/export" -H "Authorization: Bearer ${CREATOR_TOKEN}"

active Whether the subscriber currently has active subscription or not

search_nickname_exact Returns subscribers with exact nickname matched

search_nickname_pattern Returns subscribers with nickname matching LIKE pattern (LIKE '%{nickname}%')

search_case_sensitive Whether to use case-sensitivity or not for subscribers search

membership_setting_id Returns susbcribers that subscribes to a membership_setting_id

Sample response (similar to List subscribers API)

{
    "data": [
        {
            "supporter_user_id": "{user_id}",
            "supporter_nickname": "...",
            "supporter_avatar": null,
            "membership_setting_id": "...",
            "subscription_start": "...",
            "subscription_end": "...",
            "subscription_type_latest": "RECURRING",
            "subscription_period": 1,
            "latest_membership_detail_id": "{membership_detail_id}",
            "latest_membership_detail_month": 1
        }
    ],
    "total": 1
}

(V1) Get payment detail

Get detailed information for a transaction

Sample request

curl -XGET "${V1_API}/v1/payment/transaction/{id}" -H "Authorization: Bearer ${LOGIN_TOKEN}"

id The payment ID

Sample response

{
    "human_id": "UM-260105-5UOW4VDKN",
    "payment_status": "SUCCEED",
    "usecase_data": {
        "data": {
            "subscriber_user_id": "fba1aaba-ffb5-42ae-8571-6ec0eb337802",
            "subscriber_user_nickname": "notruff4",
            "membership_detail_id": "d194ec77-aa7e-49d9-94a7-99be7a317f1e",
            ...
        },
        "usecase": "USER_MEMBERSHIP_RECURRING"
    },
    ...
}

(V1) Get current user information

Get detailed information about your Gank account

Sample request

curl -XGET "${V1_API}/v1/users/me" -H "Authorization: Bearer ${LOGIN_TOKEN}"

Sample response

{
    "data": {
        "id": "fba1aaba-ffb5-42ae-8571-6ec0eb337802",
        "nickname": "notruff4",
        ...
    },
    "total": 0
}

(V1) Get membership setting information

Get detailed information about your membership settings

Sample request

curl -XGET "${V1_API}/v1/users/membership-settings-v2/{user_id}" -H "Authorization: Bearer ${LOGIN_TOKEN}"

user_id Your Gank user ID

Sample response

{
  "data":
    [
      {
        "id": "{membership_setting_id}",
        ...,
        "membershipDetails":
          [
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            }
          ]
      },
      {
        "id": "{membership_setting_id}",
        ...,
        "membershipDetails":
          [
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            },
            {
              "id": "{membership_detail_id}",
              ...
            }
          ]
      }
    ],
  "total": 2
}

(V1) Get shop listing information

Get detailed information about your shop listings

Sample request

curl -XGET "${V1_API}/v1/catalogs/services?userID={userID}"

userID Your Gank user ID

Sample response

{
    "data": [
        {
            "id": "4ae9d5c2-959f-42d6-a463-6c0003c95c8c",
            "name": "Test Listing!",
            "description": "Test Description!",
            "servicePrices": [
                {
                    "rate_usd": 20
                    // ...
                }
            ],
            // ...
        },
        {
            "id": "f3f17de3-5a40-4e50-9cb3-60c071e6464e",
            "name": "Test Listing!",
            "description": "Test Description!",
            "servicePrices": [
                {
                    "rate_usd": 10
                    // ...
                }
            ],
            // ...
        }
        // ...
    ]
}