{
  "description": "Publicly accessible APIs that allows firebase in-app messaging SDKs/Clients to communicate with servers for fetching message definitions. ",
  "title": "Firebase In-App Messaging API",
  "name": "firebaseinappmessaging",
  "version": "v1",
  "ownerDomain": "google.com",
  "discoveryVersion": "v1",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "id": "firebaseinappmessaging:v1",
  "baseUrl": "https://firebaseinappmessaging.googleapis.com/",
  "documentationLink": "https://firebase.google.com",
  "protocol": "rest",
  "servicePath": "",
  "mtlsRootUrl": "https://firebaseinappmessaging.mtls.googleapis.com/",
  "parameters": {
    "key": {
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
      "location": "query",
      "type": "string"
    },
    "callback": {
      "location": "query",
      "description": "JSONP",
      "type": "string"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    },
    "prettyPrint": {
      "type": "boolean",
      "default": "true",
      "description": "Returns response with indentations and line breaks.",
      "location": "query"
    },
    "upload_protocol": {
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string",
      "location": "query"
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string",
      "location": "query"
    },
    "access_token": {
      "description": "OAuth access token.",
      "type": "string",
      "location": "query"
    },
    "alt": {
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "description": "Data format for response.",
      "type": "string",
      "default": "json",
      "location": "query",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ]
    },
    "quotaUser": {
      "location": "query",
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
      "type": "string"
    },
    "uploadType": {
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query",
      "type": "string"
    },
    "$.xgafv": {
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ],
      "location": "query",
      "type": "string"
    }
  },
  "kind": "discovery#restDescription",
  "revision": "20261026",
  "resources": {
    "sdkServing": {
      "resources": {
        "projects": {
          "resources": {
            "eligibleCampaigns": {
              "methods": {
                "fetch": {
                  "path": "v1/sdkServing/projects/{projectNumber}/eligibleCampaigns:fetch",
                  "description": "Retrieve fiam messages that are suitable for the current client app instance. A suitable campaign message needs to satisfy 3 conditions 1 Active campaign 2 The requesting client app instance meets the targeting requirement for the campaign 3 The message is still yet to be rendered by the requesting client app instance based on the display policy for the campaign. Parameter already_seen_campaign in the request object is used to help serve this purpose. Due to potential risk of a long list of already_seen_campaigns causing the url to reach the length limit, it's modeled as a POST request (so we can use body to carry the request data) with custom method even though it's essentially a read operation. The returned list of campaign messages are sorted from high priority to low priority so that the client can display them in the order as seen in the response.",
                  "flatPath": "v1/sdkServing/projects/{projectNumber}/eligibleCampaigns:fetch",
                  "response": {
                    "$ref": "FetchEligibleCampaignsResponse"
                  },
                  "parameterOrder": [
                    "projectNumber"
                  ],
                  "request": {
                    "$ref": "FetchEligibleCampaignsRequest"
                  },
                  "httpMethod": "POST",
                  "parameters": {
                    "projectNumber": {
                      "required": true,
                      "description": "[required] the unique numeric string identifying the firebase project that the client app belongs",
                      "location": "path",
                      "type": "string"
                    }
                  },
                  "id": "firebaseinappmessaging.sdkServing.projects.eligibleCampaigns.fetch"
                }
              }
            }
          }
        }
      }
    }
  },
  "rootUrl": "https://firebaseinappmessaging.googleapis.com/",
  "canonicalName": "Firebase In-App Messaging API",
  "version_module": true,
  "schemas": {
    "Text": {
      "type": "object",
      "id": "Text",
      "properties": {
        "localizations": {
          "items": {
            "$ref": "Localization"
          },
          "type": "array"
        },
        "sourceLangCode": {
          "type": "string"
        },
        "text": {
          "type": "string",
          "description": "Message text."
        },
        "hexColor": {
          "type": "string",
          "description": "Message font color."
        }
      }
    },
    "Button": {
      "type": "object",
      "id": "Button",
      "properties": {
        "buttonHexColor": {
          "type": "string",
          "description": "Button background color."
        },
        "text": {
          "$ref": "Text",
          "description": "Button text."
        }
      }
    },
    "EventParam": {
      "id": "EventParam",
      "type": "object",
      "properties": {
        "floatValue": {
          "type": "number",
          "format": "float"
        },
        "intValue": {
          "type": "string",
          "format": "int64"
        },
        "stringValue": {
          "type": "string"
        },
        "doubleValue": {
          "type": "number",
          "format": "double"
        },
        "paramValue": {
          "type": "array",
          "items": {
            "$ref": "EventParam"
          },
          "description": "List of EventParams. No additional nesting/recursion is allowed."
        },
        "name": {
          "description": "The name of the event param. The max size of the event name is TBD but it will be constrained to 24 or 32 chars.",
          "type": "string"
        }
      },
      "description": "Additional information about an Event. Can be automatically generated by client SDKs or provided directly by the developer. Next ID to use: 7 LINT.IfChange"
    },
    "ClientAppInfo": {
      "description": "it has the info in identifying the client app making the request",
      "properties": {
        "appInstanceIdToken": {
          "type": "string",
          "description": "[required] app instance id token"
        },
        "appInstanceId": {
          "description": "[required] app instance id",
          "type": "string"
        },
        "gmpAppId": {
          "description": "[required] the unique app id for the client app",
          "type": "string"
        },
        "sdkVersion": {
          "description": "[optional] SDK version from which the request is being made in the format: : e.g ios:3.14 or android:13.37",
          "type": "string"
        }
      },
      "id": "ClientAppInfo",
      "type": "object"
    },
    "ImageOnlyMessage": {
      "type": "object",
      "properties": {
        "action": {
          "description": "[optional] The Action to take when clicking anywhere on the image.",
          "$ref": "Action"
        },
        "imageUrl": {
          "description": "The url of the image to be sent as the message.",
          "type": "string"
        }
      },
      "id": "ImageOnlyMessage"
    },
    "VanillaCampaignPayload": {
      "id": "VanillaCampaignPayload",
      "type": "object",
      "properties": {
        "campaignStartTimeMillis": {
          "type": "string",
          "format": "int64",
          "description": "Start time of the campaign - we use long vs Timestamp here to minimize the size of the bundles sent back to the sdk clients"
        },
        "campaignId": {
          "type": "string",
          "description": "Campaign id"
        },
        "experimentalCampaignId": {
          "description": "[optional] if the campaign is the result of a rolled out campaign, the old experimental campaign id here is used for impression tracking on the client",
          "type": "string"
        },
        "campaignName": {
          "type": "string",
          "description": "[optional] the display name for the campaign given by the campaign creator. we need it for generating fiam campaign analytic events on client SDK side"
        },
        "campaignEndTimeMillis": {
          "format": "int64",
          "type": "string",
          "description": "[optional] end time of the campaign - we use long vs Timestamp here to minimize the size of the bundles sent back to the sdk clients"
        }
      }
    },
    "ClientSignals": {
      "id": "ClientSignals",
      "type": "object",
      "properties": {
        "timeZone": {
          "description": "Optional. Time zone in Olson ID format (eg: \"America/Los_Angeles\"). Case-sensitive. Android - TimeZone.getDefault().getID() - http://shortn/_euxZnYYP1G. iOS - NSTimeZone.name - http://shortn/_mTknrZvUIT",
          "type": "string"
        },
        "appVersion": {
          "description": "Optional. The App version. Android - versionName - http://shortn/_SXW3Wxg972 iOS - CFBundleVersion - http://shortn/_Z1l0Lv8Kq6",
          "type": "string"
        },
        "languageCode": {
          "type": "string",
          "description": "Optional. Device language in the BCP47 format. For example \"en-US\". This is case-insensitive. Android - Locale.getDefault() iOS - "
        },
        "platformVersion": {
          "description": "Optional. The Platform Version of the device. Android - The API level. http://shortn/_3fAA60nsoy iOS - A version of the format \"X.Y.Z\". http://shortn/_lY40KS4SNt NOTE(tal): as of Jan 2018 this signal is not used in common targeting.",
          "type": "string"
        }
      },
      "description": "A set of signals which are collected on the client and are included in requests by Firebase Services (eg. Remote Config, Digital Goods etc). NOTE: These will eventually not be needed in the request when we have an App Checkin service which will upload these signals periodically."
    },
    "TriggeringCondition": {
      "description": "Triggering condition for determing when the campaign will be shown to targeted users. Can be either a FiamTrigger, or a Scion Event",
      "properties": {
        "fiamTrigger": {
          "type": "string",
          "enum": [
            "UNKNOWN_TRIGGER",
            "APP_LAUNCH",
            "ON_FOREGROUND"
          ],
          "enumDescriptions": [
            "",
            "App is launched.",
            "App has already launched and is brought into the foreground."
          ]
        },
        "event": {
          "$ref": "Event"
        }
      },
      "type": "object",
      "id": "TriggeringCondition"
    },
    "CampaignImpression": {
      "properties": {
        "impressionTimestampMillis": {
          "type": "string",
          "description": "[required] when instance last displayed the content for this campaign",
          "format": "int64"
        },
        "campaignId": {
          "description": "[required] campaign_id",
          "type": "string"
        }
      },
      "type": "object",
      "description": "A campaign id and timestamp noting when the device displayed this campaign",
      "id": "CampaignImpression"
    },
    "ExperimentPayload": {
      "properties": {
        "overflowPolicy": {
          "enumDescriptions": [
            "See go/protosdosdonts.",
            "Discard oldest experiments (by experiment_start_time) first.",
            "Ignore newest experiments first."
          ],
          "enum": [
            "POLICY_UNSPECIFIED",
            "DISCARD_OLDEST",
            "IGNORE_NEWEST"
          ],
          "description": "The overflow policy enum for this experiment payload.",
          "type": "string"
        },
        "setEventToLog": {
          "description": "The event logged when impact service sets the experiment. Max length = 32 chars",
          "type": "string"
        },
        "triggerEvent": {
          "type": "string",
          "description": "The Scion event that causes the experiment to transition to ON state."
        },
        "triggerTimeoutMillis": {
          "description": "Duration in milliseconds that the experiment can stay in STANDBY state. Valid range is from 1ms to 6 months (current max defined by Scion). If the value is outside this range the setExperiment call on the client will fail. Required field",
          "type": "string",
          "format": "int64"
        },
        "ongoingExperiments": {
          "items": {
            "$ref": "ExperimentLite"
          },
          "description": "A list of all other ongoing (started, and not yet stopped) experiments at the time this experiment was started. Does not include this experiment; only the others.",
          "type": "array"
        },
        "timeToLiveMillis": {
          "description": "Duration in milliseconds that the experiment can stay in ON state (an experiment becomes ON when it has been triggered, or when it has no trigger event). Corresponds to the attribution time in the ABT UI. Valid range is from 1ms to 6 months (current max defined by Scion). If the value is outside this range the setExperiment call on the client will fail. Required field",
          "format": "int64",
          "type": "string"
        },
        "activateEventToLog": {
          "description": "The event logged when an experiment goes to the ON state. Max length = 32 chars",
          "type": "string"
        },
        "clearEventToLog": {
          "type": "string",
          "description": "The event logged when an experiment is cleared. Max length = 32 chars"
        },
        "timeoutEventToLog": {
          "type": "string",
          "description": "The event logged when an experiment times out after trigger_timeout_millis milliseconds. Max length = 32 chars"
        },
        "ttlExpiryEventToLog": {
          "type": "string",
          "description": "The event logged when an experiment times out after time_to_live_millis milliseconds. Max length = 32 chars"
        },
        "experimentStartTimeMillis": {
          "type": "string",
          "description": "Epoch time in milliseconds when the experiment was started; \u003e 0. Required field.",
          "format": "int64"
        },
        "experimentId": {
          "type": "string",
          "description": "A string of max length 22 characters. Format: _exp_ This is referred to as the tracking id and is different from the experiment id which is used internally by ABT. Required field."
        },
        "variantId": {
          "type": "string",
          "description": "A string which has numbers from 0-10. Required field."
        }
      },
      "id": "ExperimentPayload",
      "description": "ABT Payload for Firebase Namespace.",
      "type": "object"
    },
    "ExperimentLite": {
      "description": "A lighter version of ExperimentPayload that describes an experiment by only its experimentId. To be used when we don't need to know all the details about the experiment, such as when sending a list of all ongoing experiments.",
      "type": "object",
      "properties": {
        "experimentId": {
          "description": "A string of max length 22 characters. Format: _exp_ Required field.",
          "type": "string"
        }
      },
      "id": "ExperimentLite"
    },
    "FetchEligibleCampaignsRequest": {
      "id": "FetchEligibleCampaignsRequest",
      "type": "object",
      "properties": {
        "alreadySeenCampaigns": {
          "description": "a list of campaigns that have already been rendered by the client so that service can filter them out while doing search of applicable messages",
          "items": {
            "$ref": "CampaignImpression"
          },
          "type": "array"
        },
        "clientSignals": {
          "description": "[required] A common set of targeting signals - ex: user properties, lang",
          "$ref": "ClientSignals"
        },
        "requestingClientApp": {
          "$ref": "ClientAppInfo"
        }
      }
    },
    "ThickContent": {
      "description": "The 'thick' message that gets sent to clients",
      "type": "object",
      "id": "ThickContent",
      "properties": {
        "isTestCampaign": {
          "description": "if true, it's a campaign that's to be tested on client side. otherwise, it it's a regular message to be rendered.",
          "type": "boolean"
        },
        "priority": {
          "description": "Priority of the campaign/message If two messages have the same priority, the one from the most-recently-started campaign will 'win'",
          "$ref": "Priority"
        },
        "content": {
          "$ref": "Content",
          "description": "Content"
        },
        "experimentalPayload": {
          "$ref": "ExperimentalCampaignPayload"
        },
        "triggeringConditions": {
          "type": "array",
          "description": "condition to trigger the FIAM",
          "items": {
            "$ref": "TriggeringCondition"
          }
        },
        "vanillaPayload": {
          "$ref": "VanillaCampaignPayload"
        },
        "dataBundle": {
          "description": "[optional] user-defined data bundle. This data is meant for the developer to use in the SDK at runtime when a campaign is displayed. For more info: (go/fiam-data-bundles)",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "Localization": {
      "properties": {
        "langCode": {
          "type": "string"
        },
        "text": {
          "type": "string"
        }
      },
      "type": "object",
      "description": "A tuple of text and the language it is in.",
      "id": "Localization"
    },
    "Event": {
      "id": "Event",
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "description": "Events without timestamps will be grouped together by set of params and will be reported with occurrence count. This is lossless client side aggregation to pack the data in more compact form. Events with different set of params will be logged with different EventParam message.",
          "format": "int32"
        },
        "params": {
          "type": "array",
          "items": {
            "$ref": "EventParam"
          }
        },
        "correctedTimestampMillis": {
          "type": "string",
          "format": "int64",
          "description": "Network-derived UTC timestamp for when an event was logged in millis. go/ga4f-robust-time-source-dd"
        },
        "launchLoggingTimestampMillis": {
          "description": "UTC client time when a first open/first visit event was actually logged. Such events are timestamped with the app first open time rather than the logging time so this is a separate signal which may be useful in case there is a significant delay between the app being launched and the event being logged.",
          "format": "int64",
          "type": "string"
        },
        "previousTimestampMillis": {
          "description": "UTC client time when the most recent event of the same type happened in millis.",
          "type": "string",
          "format": "int64"
        },
        "timestampMillis": {
          "type": "string",
          "description": "UTC client time when the transaction happened in millis.",
          "format": "int64"
        },
        "name": {
          "type": "string",
          "description": "The event name. Event name length will be limited to something short like 24 or 32 chars. The exact max length limit is TBD."
        }
      },
      "description": "Information about activity on the app. Can be automatically generated by client SDKs or provided directly by the app developer. Next ID to use: 9 LINT.IfChange"
    },
    "FetchEligibleCampaignsResponse": {
      "id": "FetchEligibleCampaignsResponse",
      "properties": {
        "expirationEpochTimestampMillis": {
          "type": "string",
          "description": "epoch time at which time clients must invalidates their cache",
          "format": "int64"
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "ThickContent"
          },
          "description": "list of eligible messages sorted in high-to-low priority order"
        }
      },
      "type": "object"
    },
    "Content": {
      "type": "object",
      "description": "Content of a Firebase in-app message.",
      "properties": {
        "banner": {
          "description": "Banner mode",
          "$ref": "BannerMessage"
        },
        "card": {
          "$ref": "CardMessage",
          "description": "Card mode"
        },
        "imageOnly": {
          "description": "Entire message is provided by the developer as an image",
          "$ref": "ImageOnlyMessage"
        },
        "modal": {
          "description": "Modal mode",
          "$ref": "ModalMessage"
        }
      },
      "id": "Content"
    },
    "Action": {
      "type": "object",
      "id": "Action",
      "description": "This defines the action to be taken on click: For now, only the url to navigate to.",
      "properties": {
        "actionUrl": {
          "description": "Action url",
          "type": "string"
        }
      }
    },
    "ModalMessage": {
      "type": "object",
      "properties": {
        "backgroundHexColor": {
          "type": "string",
          "description": "[optional] Message background color."
        },
        "title": {
          "$ref": "Text",
          "description": "[required] Message title."
        },
        "imageUrl": {
          "type": "string",
          "description": "[optional] Image to display (https url - it will be downloaded onto the device) No prefix required."
        },
        "action": {
          "$ref": "Action",
          "description": "[optional] The Action to take when clicking on the button. Currently, the two must be set together: action.isSet() iff actionButton.isSet()"
        },
        "actionButton": {
          "description": "[optional] Message button. Clicking this button will trigger the modal's action Currently, the two must be set together: action.isSet() iff actionButton.isSet()",
          "$ref": "Button"
        },
        "body": {
          "$ref": "Text",
          "description": "[optional] Message body."
        }
      },
      "id": "ModalMessage"
    },
    "ExperimentalCampaignPayload": {
      "type": "object",
      "properties": {
        "campaignEndTimeMillis": {
          "format": "int64",
          "type": "string",
          "description": "FIAM configured end time of the experiment - we use long vs Timestamp here to minimize the size of the bundles sent back to the sdk clients. Note that for an experiment the end time is defined by whichever is earliest of (campaign end time, experiment time to live)"
        },
        "campaignName": {
          "type": "string",
          "description": "The display name for the campaign given by the campaign creator. we need it for generating fiam campaign analytic events on client SDK side"
        },
        "experimentPayload": {
          "$ref": "ExperimentPayload",
          "description": "payload is sent for scion tracking of the experiment this is provied by ABT"
        },
        "campaignStartTimeMillis": {
          "description": "FIAM configured start time of the experiment - we use long vs Timestamp here to minimize the size of the bundles sent back to the sdk clients",
          "format": "int64",
          "type": "string"
        },
        "campaignId": {
          "type": "string",
          "description": "Campaign id"
        }
      },
      "id": "ExperimentalCampaignPayload"
    },
    "Priority": {
      "properties": {
        "value": {
          "description": "Priority value can range from 1-10, with 1 being the highest priority.",
          "type": "integer",
          "format": "int32"
        }
      },
      "id": "Priority",
      "type": "object",
      "description": "Priority of the campaign. Used to select the most important messages amongst a set of eligible ones."
    },
    "BannerMessage": {
      "id": "BannerMessage",
      "type": "object",
      "properties": {
        "title": {
          "$ref": "Text",
          "description": "[required] Message title."
        },
        "action": {
          "description": "[optional] Action to take when banner is clicked",
          "$ref": "Action"
        },
        "backgroundHexColor": {
          "type": "string",
          "description": "[optional] Message background color."
        },
        "imageUrl": {
          "type": "string",
          "description": "[optional] Image to display (https url - it will be downloaded onto the device) No prefix required."
        },
        "body": {
          "description": "[optional] Message body.",
          "$ref": "Text"
        }
      }
    },
    "CardMessage": {
      "properties": {
        "landscapeImageUrl": {
          "description": "[optional] HTTPS url of the image to display in landscape orientation of the device. If missing, the client will default to using the portrait image url.",
          "type": "string"
        },
        "body": {
          "$ref": "Text",
          "description": "[optional] Message body."
        },
        "title": {
          "$ref": "Text",
          "description": "[required] Message title."
        },
        "secondaryAction": {
          "description": "[optional] The action to take when the secondary action button is clicked.",
          "$ref": "Action"
        },
        "primaryActionButton": {
          "description": "[required] Message button. Clicking this button will trigger the modal's primary action If the primary action is not provided, the button simply dismisses the message.",
          "$ref": "Button"
        },
        "primaryAction": {
          "description": "[optional] The action to take when clicking on the primary button.",
          "$ref": "Action"
        },
        "backgroundHexColor": {
          "type": "string",
          "description": "[required] Message background color."
        },
        "portraitImageUrl": {
          "description": "[required] HTTPS url of the image to display in portrait orientation of the device.",
          "type": "string"
        },
        "secondaryActionButton": {
          "description": "[optional] Message button. Clicking this button will trigger the modal's secondary action If the secondary action is not provided, the button simply dismisses the message.",
          "$ref": "Button"
        }
      },
      "id": "CardMessage",
      "type": "object"
    }
  },
  "batchPath": "batch",
  "basePath": "",
  "ownerName": "Google"
}
