{
  "item": [
    {
      "id": "810649fc-b0b6-489b-8628-b389f8c2d013",
      "name": "Launch Links",
      "description": {
        "content": "",
        "type": "text/plain"
      },
      "item": [
        {
          "id": "37ad961c-4901-4874-9250-a9a53aa0c87a",
          "name": "Lists Launch Links for a Campaign",
          "request": {
            "name": "Lists Launch Links for a Campaign",
            "description": {},
            "url": {
              "path": [
                "api",
                "v1",
                "campaigns",
                ":campaign_id",
                "launch_links"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "type": "any",
                  "value": "<string>",
                  "key": "campaign_id",
                  "description": "(Required) "
                }
              ]
            },
            "header": [
              {
                "key": "Accept",
                "value": "application/vnd.api+json"
              }
            ],
            "method": "GET",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{bearerToken}}"
                }
              ]
            }
          },
          "response": [
            {
              "id": "d7044f21-8648-4b44-a48c-27c058b52814",
              "name": "Successful",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "v1",
                    "campaigns",
                    ":campaign_id",
                    "launch_links"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "<string>",
                      "key": "campaign_id",
                      "description": "(Required) "
                    }
                  ]
                },
                "header": [
                  {
                    "description": {
                      "content": "Added as a part of security scheme: bearer",
                      "type": "text/plain"
                    },
                    "key": "Authorization",
                    "value": "Bearer <token>"
                  },
                  {
                    "key": "Accept",
                    "value": "application/vnd.api+json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/vnd.api+json"
                }
              ],
              "body": "{\n  \"data\": [\n    {\n      \"id\": \"abC1234\",\n      \"type\": \"launch_links\",\n      \"attributes\": {\n        \"created_at\": \"2021-01-17T19:37:47.151Z\",\n        \"custom_param_value\": \"JC=Product+Quiz+LP\",\n        \"enabled\": \"true\",\n        \"label\": \"Product Quiz LP\",\n        \"link_group\": \"Owned Web\",\n        \"link_parameter\": \"L=Owned+Web\",\n        \"include_uid_param\": \"false\",\n        \"complete_live_link\": \"http://localhost:3001/bce4291?L=Owned+Web&JC=Product+Quiz+LP\"\n      }\n    },\n    {\n      \"id\": \"def6789\",\n      \"type\": \"launch_links\",\n      \"attributes\": {\n        \"created_at\": \"2020-12-29T18:58:35.791Z\",\n        \"custom_param_value\": \"null\",\n        \"enabled\": \"true\",\n        \"label\": \"Linkedin\",\n        \"link_group\": \"Linkedin\",\n        \"link_parameter\": \"L=Linkedin\",\n        \"include_uid_param\": \"false\",\n        \"complete_live_link\": \"http://localhost:3001/bce4291?L=Linkedin\"\n      }\n    }\n  ]\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "3a98ab5e-e49b-4b14-b12e-5521f13d19ad",
              "name": "Unauthorized",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "v1",
                    "campaigns",
                    ":campaign_id",
                    "launch_links"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "<string>",
                      "key": "campaign_id",
                      "description": "(Required) "
                    }
                  ]
                },
                "header": [
                  {
                    "description": {
                      "content": "Added as a part of security scheme: bearer",
                      "type": "text/plain"
                    },
                    "key": "Authorization",
                    "value": "Bearer <token>"
                  },
                  {
                    "key": "Accept",
                    "value": "application/vnd.api+json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Unauthorized",
              "code": 401,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/vnd.api+json"
                }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"status\": 401,\n      \"title\": \"Unauthorized Request\"\n    }\n  ]\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            },
            {
              "id": "2189fb1a-4e54-4fd0-a674-f05fb1655b7a",
              "name": "Forbidden",
              "originalRequest": {
                "url": {
                  "path": [
                    "api",
                    "v1",
                    "campaigns",
                    ":campaign_id",
                    "launch_links"
                  ],
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "query": [],
                  "variable": [
                    {
                      "disabled": false,
                      "type": "any",
                      "value": "<string>",
                      "key": "campaign_id",
                      "description": "(Required) "
                    }
                  ]
                },
                "header": [
                  {
                    "description": {
                      "content": "Added as a part of security scheme: bearer",
                      "type": "text/plain"
                    },
                    "key": "Authorization",
                    "value": "Bearer <token>"
                  },
                  {
                    "key": "Accept",
                    "value": "application/vnd.api+json"
                  }
                ],
                "method": "GET",
                "body": {}
              },
              "status": "Forbidden",
              "code": 403,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/vnd.api+json"
                }
              ],
              "body": "{\n  \"errors\": [\n    {\n      \"status\": 401,\n      \"title\": \"Unauthorized Request\"\n    }\n  ]\n}",
              "cookie": [],
              "_postman_previewlanguage": "json"
            }
          ],
          "event": [],
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          }
        }
      ],
      "event": []
    }
  ],
  "event": [],
  "variable": [
    {
      "type": "string",
      "value": "https://api2.jebbit.com/",
      "key": "baseUrl"
    }
  ],
  "info": {
    "_postman_id": "68fcbc07-1614-462e-8e49-c2d8508b20e0",
    "name": "Jebbit Auth Launch Links API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": {
      "content": "# Introduction\nUse our Jebbit API to automate tasks relating to your Jebbit Businesses, Campaigns, Product Feed, Launch Links, and Integrations.\n# Authentication Guide\nUse the `client_id` and `client_secret` provided by Jebbit in the [Auth Endpoint](/#tag/Auth) to generate an `access_token`. This token is valid for 24 hours. After that you'll need to hit the endpoint again to generate a new token.\n## Making API Requests\nJebbit requires your `access_token` (which is a [Json Web Token](https://jwt.io/) / JWT) to be included in all API requests. It must be sent in the `Authorization` header in the following format:\n\n`Authorization: Bearer <your access_token here>`\n\n**Important:** If your `access_token` has permissions (scopes) to multiple businesses, then we require you to send an `x-jebbit-business` header with every request. The value of this header is a business' ID. This header sets the scope of the request to the business provided.\n## API Resource Sorting\nAll resources from the API are listed descending by the time they were created.\n# Integration/Webhook Client Guide\nWhen using our [Integrations endpoint](/#tag/Integrations) to receive Jebbit webhooks there are a few key things you want to keep top-of-mind. To help assist in this process, we've created an [Example Webhook Client Repo](https://github.com/jebbit/jebbit-webhook-client-example) as a kickstarter.\n## Test Webhooks\nYou're able to [send a test webhook](/#tag/Integrations/) to your endpoint to verify that your integration and endpoint are properly set up. Test Webhooks allow you to test out the signature verification process before activating your Integration.\n\n**Important:** Jebbit sends an `x-jebbit-test` header with every test webhook. You should ensure there is logic in your application to properly discard these webhooks and not continue processing them through your data ingestion process.\n## Jebbit Webhooks\nAll webhooks Jebbit sends contain an `x-jebbit-signature` header. This header is how you can verify that the request to your endpoint is from Jebbit.\n## Anatomy of a Jebbit Signature\nThe value of a Jebbit Signature will be a string with two key/value pairs separated by a comma. The first part is the unix timestamp of when the webhook was sent and the second part is the hmac of the payload it carries.\n`x-jebbit-signature: t=#{timestamp},v1=#{hmac}`\n## Verifying a Signature\nThe first step of validating a signature is ensuring that the timestamp provided is within a reasonable threshold from the current timestamp, say 5 minutes. If a webhook is outside of this threshold it is recommended to not process it any further -- this helps guard against replay attacks.\n\n\n```ruby\n# Example in Ruby\nif timestamp < Time.now.to_i - 300 # 300 seconds = 5 minutes\n  raise StandardError, 'Timestamp outside of tolerance'\nend\n```\n\nThe next step will be to verify the `hmac` passed along by the `v1` attribute of the signature. To verify this you'll need to do the following:\n\n```ruby\n# Example in Ruby/Rails\n# Step 1 - regenerate the payload by using the timestamp the header\ngenerated_payload = \"#{timestamp}.#{request.body}\"\n\n# Step 2 - create an HMAC of the generated_payload using the `shared_secret` for the integration\n\ncalculated_hmac = Base64.strict_encode64(\n  OpenSSL::HMAC.digest('sha256', shared_secret, generated_payload)\n)\n\n# Step 3 - securely verify that the two hmacs are equal\nActiveSupport::SecurityUtils.secure_compare(hmac, calculated_hmac)\n\n# if they are equal, then you can accept the payload as valid & continue processing.\n```\n",
      "type": "text/plain"
    }
  }
}