### Example Authentication Response JSON Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide An example of a successful JSON response from the authentication request, indicating 'OK' status and providing the authorization token. ```JSON { "response" : { "token" : "authn:225692:2d787d1838283:lax1", "status" : "OK" } } ``` -------------------------------- ### Xandr Site Creation API Reference Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup Comprehensive documentation for creating a new site via the Xandr API. Includes the required JSON request payload structure, the cURL command for making the POST request to the `/site` endpoint, and an example of the successful JSON response, detailing the site's properties and ID. ```json { "site" : { "name" : "NEW_SITE_NAME", "rtb" : true, "content_categories" : [ { "id" : 8, "name" : "Business & Industry", "is_system" : true }, { "name" : "Arts & Entertainment", "id" : 10, "is_system" : true }, { "is_system" : true, "id" : 29, "name" : "Sports" } ] } } ``` ```bash curl -b cookies -X POST -d @NewSite.json 'https://api.appnexus.com/site publisher_id=PUBLISHER_ID' ``` ```json { "response" : { "status" : "OK", "start_element" : 0, "id" : 3804119, "num_elements" : 100, "site" : { "content_categories" : [ { "id" : 8, "is_system" : true, "name" : "Business & Industry" }, { "name" : "Arts & Entertainment", "is_system" : true, "id" : 10 }, { "is_system" : true, "id" : 29, "name" : "Sports" } ], "id" : 3804119, "creative_formats" : [ "text" ], "mobile_app_instance" : null, "audited" : false, "rtb_optimization_zone_id" : null, "marketplace_map" : { "rtb" : true, "performance" : false, "deals_suspended" : false, "rtb_suspended" : false, "an_audit_perf_only" : false, "deals_allowed" : true }, "supply_type" : "web", "code" : null, "creative_format_action" : "exclude", "inventory_attributes" : null, "name" : "NEW_SITE_NAME", "allowed_click_actions" : [ "click-to-web" ], "intended_audience" : null, "publisher_id" : 1229638, "primary_content_category_id" : null, "managed_optimization_zone_id" : "262", "publisher_name" : "MarkD_Test05", "placements" : null, "url" : "", "state" : "active", "last_modified" : "2018-09-08 00:01:40" }, "count" : 1 } } ``` -------------------------------- ### App Installation Service Permissions Structure Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/app-installation-service Describes the structure of the `permissions` array, detailing the `privileges` and `service` fields, including an example of the `privileges` object. ```APIDOC permissions array object fields: privileges: array of objects Description: The types of calls that the app can make to the API service and the specific fields that can be used. Structure: method: enum ("get", "post", "put", "delete") Description: Defines the calls that can be made to the service. fields: array or null Description: Restricts the permissions to particular fields in the service. If null, permissions apply to all fields. Note: Use of "delete" method must be approved by a Xandr representative. service: enum Description: The name of the API service that the app is permitted to use. privileges example: { "method": "get", "fields": null } ``` -------------------------------- ### Example JSON for Insertion Order with Multiple Budget Flights Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide Provides a JSON structure for an Xandr insertion order that defines multiple budget intervals (flights) with specific start/end dates and impression-based daily and lifetime budgets. This example demonstrates how to manage budget pacing across different periods for a single insertion order. ```JSON { "insertion-order": { "name": "Deal Line Item Example IO", "budget_intervals": [ { "start_date": "2019-10-10 00:00:00", "end_date": "2019-10-12 23:59:59", "daily_budget": null, "daily_budget_imps": 10, "enable_pacing": true, "lifetime_budget": null, "lifetime_budget_imps": 980, "lifetime_pacing": false }, { "start_date": "2019-10-13 00:00:00", "end_date": "2019-10-18 23:59:59", "daily_budget": null, "daily_budget_imps": 10, "enable_pacing": true, "lifetime_budget": null, "lifetime_budget_imps": 100, "lifetime_pacing": false } ], "budget_type": "impression" } } ``` -------------------------------- ### Example Xandr Placement Creation API Response Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup This JSON object represents a typical successful response from the Xandr /placement API after creating a new placement. It confirms the 'OK' status and provides comprehensive details of the newly created placement, including its ID and various attributes. ```JSON { "response" : { "num_elements" : 100, "placement" : { "supported_mime_types_action_include" : false, "video" : null, "default_creative_id" : null, "private_sizes" : null, "code" : null, "height" : null, "audited" : false, "state" : "inactive", "filtered_line_items" : null, "last_modified" : "2018-08-20 22:40:09", "tag_data" : null, "content_retrieval_timeout_ms" : 0, "is_prebid_enabled" : false, "toolbar" : null, "pixel_url_secure" : null, "vendor_id" : null, "supported_media_types" : [ { "id" : 1, "is_private" : false, "name" : "Banner" } ], "default_position" : "unknown", "is_resizable" : false, "code3" : null, "filtered_advertisers" : null, "exclusive" : false, "site_id" : 3731466, "estimated_clear_prices" : [ { "average_price" : 0.5, "verified" : true, "clear_price" : 1, "width" : 0, "geo_country" : "", "height" : 0 } ], "name" : "NEW_PLACEMENT_NAME", "site_audit_status" : "unaudited", "site_name" : "SITE_NAME", "pop_values" : null, "media_subtypes" : null, "enable_for_mediation" : true, "supported_media_subtypes" : null, "segments" : null, "pixel_url" : null, "publisher_id" : 1240580, "pixel_type" : "image", "reserve_price" : null, "content_categories" : null, "audit_level" : "site", "mime_types" : null, "visibility_profile_id" : null, "id" : 13847262, "use_detected_domain" : true, "default_creatives" : null, "hide_referer" : false, "intended_audience" : null, "width" : null, "default_referrer_url" : null, "default_calculation_type" : "gross", "buy_it_now_price" : 0, "ad_profile_id" : null, "floor_application_target" : "all", "demand_filter_action" : "default", "filtered_campaigns" : null, "inventory_attributes" : null, "ad_types" : null, "cost_cpm" : null, "code2" : null, "acb_code" : null, "publisher_name" : "PUBLISHER_NAME", "is_prohibited" : false }, "status" : "OK", "start_element" : 0, "id" : 13847262, "count" : 1 } } ``` -------------------------------- ### AppNexus App Installation API Operations Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/app-installation-service This section details the various API operations available for managing app installations on the AppNexus platform. It includes examples for retrieving, creating, updating, and deleting app installations using `curl` commands and illustrates the expected JSON request and response structures. ```APIDOC AppNexus App Installation API GET /app-installation Description: Retrieves a list of all app installations associated with the authenticated user or account. Parameters: None Example Request: $ curl -b cookies -c cookies 'https://api.appnexus.com/app-installation' Example Response: { "response":{ "status":"OK", "count":1, "start_element":0, "num_elements":100, "app-installations":[ { "id":9, "plugin_id":47, "addendum":"This is test text to demonstrate the addendum functionality.", "subscriber_entity_type":"member", "subscriber_entity_id":3754, "accepted_permission":false, "installed_on":"2013-05-01 20:58:28", "installer_user_id":5447, "permissions":null, "has_payment_access":false, "log_level_data_fee":5500, "subscriber_phone":"", "subscriber_email":"zivester@appnexus.com", "subscriber_name":"Zach Ivester" } ], "dbg_info":{ ... } } } GET /app-installation?id={id} Description: Retrieves details for a specific app installation using its unique ID. Parameters: - id (integer, required): The unique ID of the app installation. Example Request: $ curl -b cookies -c cookies 's://sand.api.appnexus.com/app-installation?id=868' Example Response: { "response":{ "status":"OK", "count":1, "start_element":null, "num_elements":null, "app-installation":{ "id":868, "plugin_id":4, "entity_type":"bidder", "entity_id":226, "status":"installed" } } } POST /app-installation Description: Installs a new application for a specific client (member). Request Body (add-app-installation.json): { "app-installation": { "plugin_id": "20", "subscriber_entity_type": "member", "subscriber_entity_id": "238" } } Example Request: $ cat add-app-installation.json { "app-installation": { "plugin_id": "20", "subscriber_entity_type": "member", "subscriber_entity_id": "238" } } $ curl -b cookies -c cookies -X POST -d @add-app-installation.json 's://api.appnexus.com/app-installation' | json-pp Example Response: { "response":{ "status":"OK", "count":1, "id":18716, "start_element":0, "num_elements":100, "app-installation":{ "id":18716, "plugin_id":20, "addendum":null, "subscriber_entity_type":"member", "subscriber_entity_id":238, "accepted_permission":true, "installed_on":"2013-05-13 12:54:50", "installer_user_id":3052, "permissions":null, "has_payment_access":false, "log_level_data_fee":null, "subscriber_phone":null, "subscriber_email":null, "subscriber_name":"Netseer - member 238" }, "dbg_info":{ ... } } } PUT /app-installation?id={id} Description: Updates properties of an existing app installation. Parameters: - id (integer, required): The unique ID of the app installation to update. Request Body (update-app-installation.json): { "app-installation": { "plugin_id": "19", "addendum": "www.site.com", "accepted_permission": false, "log_level_data_fee": "2000", "subscriber_phone": "914-555-1212", "subscriber_email": "JMS@live.com", "subscriber_name": "Ben Smith" } } Example Request: $ cat update-app-installation.json { "app-installation": { "plugin_id": "19", "addendum": "www.site.com", "accepted_permission": false, "log_level_data_fee": "2000", "subscriber_phone": "914-555-1212", "subscriber_email": "JMS@live.com", "subscriber_name": "Ben Smith" } } $ curl -b cookies -c cookies -X PUT -d @update-app-installation.json 's://api.appnexus.com/app-installation?id=23' Example Response: { "response":{ "status":"OK", "count":1, "id":"23", "start_element":0, "num_elements":100, "app-installation":{ "id":23, "plugin_id":50, "addendum":null, "subscriber_entity_type":"member", "subscriber_entity_id":185, "accepted_permission":false, "installed_on":"2013-05-07 15:05:45", "installer_user_id":43, "permissions":null, "has_payment_access":false, "log_level_data_fee":2500, "subscriber_phone":"", "subscriber_email":"PQ5ejohnson@appnexus.com", "subscriber_name":"Emily HB" }, "dbg_info":{ ... } } } DELETE /app-installation?id={id} Description: Deletes an app installation from the system. Parameters: - id (integer, required): The unique ID of the app installation to delete. Example Request: $ curl -b cookies -c cookies -X DELETE 'https://api.appnexus.com/app-installation?id=121' Example Response: { "response":{ "status":"OK", "count":1, "start_element":0, "num_elements":100, "dbg_info":{ ... } } } ``` -------------------------------- ### Retrieve Xandr Member Object Details via API Source: https://learn.microsoft.com/en-us/xandr/bidders/integrate-a-bidder This example demonstrates how to make a GET call to the Xandr API to retrieve details of a member object. It shows the `curl` command used to query the `/member/{id}` endpoint and provides a sample JSON response containing various member attributes. ```bash $ export IB="https://api.adnxs.com"; $ curl -b $IB/member/1234 ``` ```json { "response": { "count": 1, "dbg": { "output_term": "member", "version": "1.18.1651", "warnings": [ ] }, "member": { "account_owner_user": { "first_name": "Peter", "id": 123456, "last_name": "Driver" }, "active": true, "active_contract": null, "age_segment_id": null, "agent_id": null, "allow_ad_profile_override": true, "allow_priority_audit": false, "audit_notify_email": null, "bidder_id": 1234, "billing_address_1": null, "billing_address_2": null, "billing_city": null, "billing_country": null, "billing_name": "ExampleMemberName", "billing_postal_code": null, "billing_region": null, "buyer_clearing_fee_pct": null, "buyer_credit_limit": 2500, "code": null, "contact_email": null, "contact_info": null, "contracts": null, "curation_deductions_allowed": false, "daily_imps_self_audited": null, "daily_imps_unaudited": null, "daily_imps_verified": null, "deal_visibility_profile_id": null, "default_accept_data_provider_usersync": true, "default_accept_demand_partner_usersync": true, "default_accept_supply_partner_usersync": true, "default_ad_profile_id": null, "default_buyer_group_id": null, "default_content_retrieval_timeout_ms": 0, "default_creatives": null, "default_enable_for_mediation": false, "default_external_audit": false, "default_tag_id": null, "description": null, "developer_id": null, "domain_blocklist_email": null, "dongle": null, "email_code": null, "enable_click_and_imp_trackers": false, "enable_facebook": false, "expose_eap_ecp_placement_settings": false, "gender_segment_id": null, "id": 1234, "is_iash_compliant": false, "last_activity": "2020-03-19 06:00:39", "max_hosted_video_size": null, "native_custom_keys": null, "platform_exposure": "public", "plugins_enabled": false, "pops_enabled_UI": false, "price_buckets": null, "prioritize_margin": false, "reporting_decimal_type": "decimal", "seller_member_groups": null, "seller_revshare_pct": null, "serving_domain": null, "sherlock_notify_email": null, "short_name": null, "tax_region_id": null, "thirdparty_pixels": null, "timezone": "EST5EDT", "vendor_id": null, "visibility_profile_id": null, "xd_coop": false }, "num_elements": 100, "start_element": 0, "status": "OK" } } ``` -------------------------------- ### Create a New Deal via Deal API Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide Illustrates how to create a new deal by defining its name, buyer ID, and version in a JSON payload, then submitting it via a POST request to the `/deal` endpoint with an appropriate `member_id`. ```json { "deal": { "name": "Deal Line Item Example Deal", "buyer": { "id": 2379 }, "version": 2 } } ``` ```shell curl -b cookies -c cookies -X POST -d @deal.json 'https://api.appnexus.com/deal?member_id=2378' ``` -------------------------------- ### Example Response for Xandr API Authentication Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/curated-deal-line-item-api-setup-guide Illustrates a successful JSON response from the Xandr /auth endpoint, showing an 'OK' status and the populated authentication token value. ```JSON { "response" : { "token" : "authn:225692:2d787d1838283:lax1", "status" : "OK" } } ``` -------------------------------- ### Xandr API Pagination Parameters and Example Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/config-service Describes the parameters available for controlling pagination in Xandr API responses, allowing users to limit the number of elements returned and specify a starting point. An example GET request demonstrates how to apply these parameters. ```APIDOC Parameters: num_elements: Type: int Description: How many elements to return. For example, start at object # 4 and return 3 objects, or # 4, 5, 6. start_element: Type: int Description: The number at which to start counting. ``` ```HTTP GET https://api.appnexus.com/prebid/config?num_element=15&start_element=10 ``` -------------------------------- ### Configure Technical Attributes for a Deal Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide An example JSON snippet demonstrating how to set `technical_attribute_restrict` to false and include a specific technical attribute (ID 1, 'Image') with an override enabled for a deal. ```JSON { "technical_attribute_restrict": false, "technical_attributes": [ { "id": 1, "name": "Image", "override": true } ] } ``` -------------------------------- ### Example JSON for Deal Trust Level Setting Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide Illustrates how to set the `audit_status_option` field within a deal object to `max_trust`, indicating that no ad profile restrictions will be applied to creatives for this deal. ```JSON "audit_status_option": "max_trust" ``` -------------------------------- ### Example JSON for Creating a Xandr Deal Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/programmatic-guaranteed-deal-through-monetize-ad-server-api-setup-guide A sample JSON payload structure used to create a new deal via the Xandr API, specifying the deal name, buyer ID, and version. ```JSON { "deal": { "name": "Deal Line Item Example Deal", "buyer": { "id": 2379 }, "version": 2 } } ``` -------------------------------- ### Authentication JSON Payload Example Source: https://learn.microsoft.com/en-us/xandr/bidders/integrate-a-bidder Provides the JSON structure required for authenticating with the platform's API, containing user credentials. This payload is typically sent in a POST request to the authentication endpoint. ```json { "auth": { "username" : "rloveland", "password" : "AppNexus1!" } } ``` -------------------------------- ### JSON Example: Media Type and Subtype Configuration Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/programmatic-guaranteed-deal-through-monetize-ad-server-api-setup-guide Illustrates the JSON structure for configuring allowed media subtypes and media types, providing concrete examples of how these fields are populated with IDs, names, and other properties. ```JSON "allowed_media_subtypes": [ { "id": 2, "last_modified": "2015-09-17 19:19:21", "media_type": { "id": 2, "media_type_group_id": 2, "name": "Pop", "uses_sizes": "sometimes" }, "name": "Popup", "native_assets": null, "permitted_sizes": null } ], "allowed_media_types": [ { "id": 1, "last_modified": "2012-03-16 21:36:10", "media_type_group_id": 1, "name": "Banner", "uses_sizes": "always" }, { "id": 4, "last_modified": "2016-08-22 16:23:12", "media_type_group_id": 1, "name": "Video", "uses_sizes": "never" } ] ``` -------------------------------- ### Example JSON for Deal Language Restrictions Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide Illustrates how to configure language restrictions within a deal object, showing `language_restrict` set to true and an array of specific languages with their IDs, names, and override settings. ```JSON "language_restrict": true, "languages": [ { "id": 1, "name": "English", "override": false }, { "id": 2, "name": "Chinese", "override": true } ] ``` -------------------------------- ### Initialize CocoaPods Podfile Source: https://learn.microsoft.com/en-us/xandr/mobile-sdk/ios-sdk-integration-instructions Navigate to your project's root directory using Terminal or a command line editor and execute this command to create a new Podfile. ```Bash pod init ``` -------------------------------- ### Example JSON for Deal Brand Restrictions Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/deal-line-item-api-setup-guide Illustrates how to configure brand restrictions within a deal object, showing `brand_restrict` set to true and an array of specific brands with their IDs, names, and override settings. ```JSON "brand_restrict": true, "brands": [ { "id": 2, "name": "1800Flowers", "override": true }, { "id": 4, "name": "Acura", "override": false } ] ``` -------------------------------- ### Xandr Buy-Side Object Creation API Endpoints Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/buy-side-setup Documentation for key API endpoints used to create buy-side objects such as advertisers, creatives, conversion pixels, and segment pixels. It details the HTTP methods, common parameters, and example JSON request/response structures based on the provided walkthrough. ```APIDOC Advertiser Service: POST /advertiser Description: Creates a new advertiser object. Request Body (advertiser.json example): { "advertiser": { "name": "string", "state": "string", "use_insertion_orders": "boolean" } } Response (example): { "response": { "status": "OK", "id": "integer" } } Creative Service: POST /creative?advertiser_id={id} Description: Creates a new creative object associated with an advertiser. Query Parameters: advertiser_id: integer (Required) - The ID of the advertiser to associate the creative with. Request Body (creative.json - structure depends on creative type, not detailed here): { ... } Pixel Service (Conversion Pixels): POST /pixel?advertiser_id={id} Description: Creates a new conversion pixel. Query Parameters: advertiser_id: integer (Required) - The ID of the advertiser to associate the pixel with. Request Body (conversionpixel.json example): { "pixel": { "name": "string", "state": "string", "trigger_type": "string", "post_click_value": "integer", "post_view_value": "integer" } } Response (example): { "response": { "status": "OK", "id": "integer" } } Segment Service (Segment Pixels): POST /segment?advertiser_id={id} Description: Creates a new segment pixel. Query Parameters: advertiser_id: integer (Required) - The ID of the advertiser to associate the segment with. Request Body (segmentpixel.json example): { "segment": { "state": "string", "short_name": "string" } } Response (example): { "response": { "status": "OK", "id": "string" } } ``` -------------------------------- ### Xandr Reporting API Workflow: Request, Status, and Download Source: https://learn.microsoft.com/en-us/xandr/bidders/report-service Comprehensive guide to the Xandr Reporting API, detailing the sequence of API calls required to initiate a report, monitor its execution status, and finally download the generated data. This includes the JSON request structure, POST request to start the report, GET request to check status, and GET request to download. ```APIDOC 1. Report Request JSON Structure: - Purpose: Defines the parameters for the report. - Fields: - "report_type": string (e.g., "platform_buyer") - "report_interval": string (e.g., "last_48_hours", "today", "month_to_date") - "columns": array of strings (dimensions and metrics, e.g., ["day","imps_bought"]) - "filters": array of objects (e.g., [{"geo_country":"US"}]). Supports arrays for multiple values within a single filter: [{"bid_type": ["learn","optimized"]}, {"geo_country":"US"}] - "orders": array of objects (e.g., [{"order_by":"day", "direction":"ASC"}]) - "format": string ("csv", "xls", "xlsx") - Example: { "report": { "report_type": "platform_buyer", "report_interval": "last_48_hours", "columns": ["day","imps_bought"], "filters": [{"geo_country":"US"}], "orders": [{"order_by":"day", "direction":"ASC"}], "format": "csv" } } 2. POST Request to Initiate Report: - Endpoint: `https://api.adnxs.com/report?member_id={member_id}` - Method: `POST` - Request Body: JSON report request (e.g., from a file `@report_request`). - Returns: JSON object containing `report_id` for tracking. - Example cURL: $ curl -b cookies -c cookies -X POST -d @report_request 'https://api.adnxs.com/report?member_id=255' - Example Response: { "response": { "status": "OK", "report_id": "ca9955709eade9a0e89f5cda5345c12r", "dbg_info": { ... } } } 3. GET Report Status: - Endpoint: `https://api.adnxs.com/report/{report_id}` - Method: `GET` - Purpose: Poll this endpoint using the `report_id` until `execution_status` is "ready". - Returns: JSON object with report details and `execution_status`. Includes `url` for download when ready. - Example cURL: $ curl -b cookies -c cookies 'https://api.adnxs.com/report/ca9955709eade9a0e89f5cda5345c12r' - Example Response: { "response": { "status": "OK", "report": { "name": null, "created_on": "2012-03-13 18:15:48", "cache_hit": false, "fact_cache_hit": false, "json_request": "{\"report\":{\"report_type\":\"network_analytics\",\"report_interval\":\"last_48_hours\",\"columns\":[\"day\",\"imps\",\"clicks\"],\"filters\":[{\"geo_country\":\"US\"},{\"entity_member_id\":\"514\"},{\"entity_member_id\":null}],\"orders\":[{\"order_by\":\"day\",\"direction\":\"ASC\"},{\"order_by\":\"imps\",\"direction\":\"DESC\"}]}}", "header_info": "Report type:,network_analytics\r\n,\r\nRun at:,2012-03-13 18:15:48\r\nStart date:,\r\nEnd date:,\r\nTimezone:,\r\nUser:,John Smith (9385)\r\n", "report_size": "10", "row_count": "35", "url": "report-download?id=ca9955709eade9a0e89f5cda5345c12r" }, "execution_status": "ready", "dbg_info": { ... } } } 4. GET Report Data Download: - Endpoint: `https://api.appnexus.com/report-download?id={download_id}` - Method: `GET` - Purpose: Download the generated report data. The `download_id` is obtained from the `url` field in the GET Report Status response. - Returns: The report data in the specified format (CSV, XLS, XLSX). - Example cURL: $ curl -b cookies -c cookies 'https://api.appnexus.com/report-download?id=' - Error Handling Tip: Use `-i` or `-v` with `curl` to expose response headers for debugging HTTPS errors during download. ``` -------------------------------- ### JSON Example: Technical Attribute Configuration Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/programmatic-guaranteed-deal-through-monetize-ad-server-api-setup-guide Provides a JSON example demonstrating the configuration of technical attribute restrictions and the inclusion of specific technical attributes, including the `override` flag. ```JSON "technical_attribute_restrict": false, "technical_attributes": [ { "id": 1, "name": "Image", "override": true } ] ``` -------------------------------- ### Create Carthage Cartfile Source: https://learn.microsoft.com/en-us/xandr/mobile-sdk/ios-sdk-integration-instructions Open the Terminal app, navigate to your project's root directory, and execute this command to create an empty Cartfile. ```Bash touch Cartfile ``` -------------------------------- ### Get AST Version Function API and Example Source: https://learn.microsoft.com/en-us/xandr/seller-tag/get-ast-version Documents the `getAstVersion()` function, which returns the current version of AST as a string. This entry includes its API signature and a JavaScript example demonstrating its usage. ```APIDOC getAstVersion() - Description: Returns the version of AST as a string. - Parameters: None - Returns: string (The version of AST, e.g., "0.8.0") ``` ```JavaScript var ver = apntag.getAstVersion(); // "0.8.0" ``` -------------------------------- ### JSON Example Response for Successful Site Update Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup This JSON object represents a successful response from the `/site` PUT request. It includes the updated site object with its properties, confirming the changes made to `content_categories`, along with a status of 'OK' and other response metadata. ```JSON { "response" : { "site" : { "url" : "", "publisher_name" : "PUBLISHER_NAME", "creative_format_action" : "exclude", "code" : null, "managed_optimization_zone_id" : "262", "audited" : false, "intended_audience" : null, "content_categories" : [ { "name" : "Business & Industry", "is_system" : true, "id" : 8 }, { "name" : "Arts & Entertainment", "is_system" : true, "id" : 10 }, { "name" : "Sports", "is_system" : true, "id" : 29 } ], "marketplace_map" : { "rtb" : true, "an_audit_perf_only" : false, "rtb_suspended" : false, "deals_suspended" : false, "deals_allowed" : true, "performance" : false }, "creative_formats" : null, "name" : "[DEFAULT_SITE_NAME] - ROS", "id" : 3731466, "mobile_app_instance" : null, "allowed_click_actions" : null, "last_modified" : "2018-08-17 23:44:07", "inventory_attributes" : null, "primary_content_category_id" : null, "state" : "active", "publisher_id" : 1240580, "rtb_optimization_zone_id" : null, "supply_type" : "web", "placements" : [ { "code" : null, "id" : 13741957 } ] }, "id" : "3731466", "start_element" : 0, "count" : 1, "status" : "OK", "num_elements" : 100 } } ``` -------------------------------- ### Authenticate with Testing API via cURL Source: https://learn.microsoft.com/en-us/xandr/bidders/integrate-a-bidder Illustrates the cURL command for authenticating against the testing API environment. The process is identical to the production API, but it uses a distinct base URL for the testing environment. ```bash export IB_TESTING="https://api-test.adnxs.com"; curl -b cookies -c cookies -X POST -d @auth.json $IB_TESTING/auth ``` -------------------------------- ### Example cURL Request for Query Engine GET Source: https://learn.microsoft.com/en-us/xandr/yield-analytics-api/query-engine-service Demonstrates how to make a GET request to the Query Engine API using cURL, passing an URL-encoded SQL query as a path parameter. This example includes authentication headers. ```cURL $ curl 'https://{{client_url}}/api/v1/rest/v1/rest/queryengine/query/select%20consumption_date,%20sum(consumed)%20 from%20OLPCS(network_products(),'2010-07-01','2010-07-31')%20group%20by%20consumption_date%20order%20by%20consumption_date%20asc' -i -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'username: {{username}}' -H 'password: {{password}}' -H 'source: {{source}}' ``` -------------------------------- ### Example JSON for Brand Restrictions Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/programmatic-guaranteed-deal-through-monetize-ad-server-api-setup-guide Illustrates how to structure the JSON to restrict a deal to specific brands, including an example of overriding ad quality profiles for a particular brand. ```JSON "brand_restrict": true, "brands": [ { "id": 2, "name": "1800Flowers", "override": true }, { "id": 4, "name": "Acura", "override": false } ] ``` -------------------------------- ### Example JSON for budget_intervals Object Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/programmatic-guaranteed-deal-through-monetize-ad-server-api-setup-guide Illustrates the structure and typical values for the `budget_intervals` array within a Programmatic Guaranteed deal line item, showing how to define start/end dates, pacing, and budget types. ```json "budget_intervals": [ { "id": 18770835, "object_id": 18601984, "object_type": "campaign_group", "start_date": "2022-08-08 00:00:00", "end_date": "2022-08-17 23:59:59", "timezone": "Europe/Paris", "code": null, "parent_interval_id": null, "creatives": null, "subflights": null, "lifetime_budget": null, "lifetime_budget_imps": 100, "lifetime_pacing": false, "enable_pacing": true, "daily_budget_imps": null, "daily_budget": null, "daily_budget_imps_opt": null, "daily_budget_opt": null, "underspend_rollover_state": false } ] ``` -------------------------------- ### Example Successful Payment Rule Update Response Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup This JSON snippet illustrates a typical successful response from the /payment-rule API after an update operation. It shows a 'status' of 'OK' and includes the full details of the updated payment rule object, confirming the changes made. ```json { "response" : { "id" : "1570229", "start_element" : 0, "count" : 1, "num_elements" : 100, "status" : "OK", "payment-rule" : { "id" : 1570229, "target_ecpm" : null, "priority" : 1, "lifetime_budget_imps" : null, "start_date" : null, "lifetime_budget" : null, "filtered_advertisers" : null, "description" : "", "last_modified" : "2018-08-21 22:26:19", "code" : null, "state" : "active", "daily_budget_imps" : null, "name" : "Base Payment Rule", "apply_cost_on_default" : false, "end_date" : null, "pricing_type" : "cpm", "buyer_type" : "both", "profile_id" : null, "revshare" : 0, "demand_filter_action" : "default", "filtered_campaigns" : null, "cost_cpm" : 0.4, "daily_budget" : null, "max_revshare" : null, "timezone" : "EST5EDT", "filtered_line_items" : null } } } ``` -------------------------------- ### Xandr Segment Service API: POST Segment Pixel Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/buy-side-setup-with-the-augmented-line-item Documents the POST operation for creating a segment pixel via the Xandr Segment Service API. It includes the JSON schema for the request body and a curl usage example. Requires an Advertiser ID. ```json { "segment": { "state": "active", "short_name": "Segment Pixel 1" } } ``` ```bash curl -b cookies -X POST -d @segmentpixel.json 'https://api.appnexus.com/segment?advertiser_id=10' ``` -------------------------------- ### Configure Dynamic Creative with JavaScript Logic Source: https://learn.microsoft.com/en-us/xandr/bidders/quick-start-creative-buying-guide JSON payload to configure a dynamic creative that embeds JavaScript logic. The script conditionally renders content based on a preview flag, including dynamic and static landing page/image URLs. Specifies content, dimensions, and template ID. ```APIDOC {"creative": { "content": "", "width": "320", "height": "50", "template": { "id": 7 } } } ``` -------------------------------- ### Xandr Pixel Service API: POST Conversion Pixel Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/buy-side-setup-with-the-augmented-line-item Documents the POST operation for creating a conversion pixel via the Xandr Pixel Service API. It includes the JSON schema for the request body and a curl usage example. Requires an Advertiser ID. ```json { "pixel": { "name": "Conversion Pixel 1", "state": "active", "trigger_type": "click", "post_click_value": 8 } } ``` ```bash curl -b cookies -X POST -d @conversionpixel.json 'https://api.appnexus.com/pixel?advertiser_id=10' ``` -------------------------------- ### Xandr Creative Object Preview URLs Source: https://learn.microsoft.com/en-us/xandr/supply-partners/faq-integration-process Provides example URLs for previewing Xandr creative objects, specifically for video and native ad markups, to inspect their full details beyond basic bid response fields. ```APIDOC Video: https://{DATACENTER}-ib.adnxs.com/cr?id={APN_CREATIVE_ID}&format=vast Native: https://{DATACENTER}-ib.adnxs.com/cr?id={APN_CREATIVE_ID}&format=json ``` -------------------------------- ### Create Ad Pod Placement with Video Bumper (AppNexus API) Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/placement-service Demonstrates how to create a new ad pod placement using the AppNexus API's `/placement` endpoint. The request defines video settings such as mid-roll context, maximum duration, number of ads, and includes an outro video bumper configuration. The `curl` command sends a POST request with the JSON payload. ```APIDOC POST /placement - Creates a new ad placement with specified video properties, including support for video bumpers. - Base URL: https://api.appnexus.com - Query Parameters: - publisher_id: integer (Required) - The ID of the publisher. - Request Body (JSON): - placement: object (Required) - video: object (Required) - supports_skippable: boolean - Indicates if skippable ads are allowed (e.g., `false`). - player_vast_version: string - VAST version supported by the player (e.g., "3.0"). - playback_method: string/null - Playback method. - max_duration_sec: integer - Maximum duration of the ad pod in seconds. - maximum_number_ads: integer - Maximum number of ads allowed in the pod. - context: string - Context of the ad placement (e.g., "mid-roll", "pre-roll", "post-roll"). - start_delay_secs: integer - Delay in seconds before the ad starts. - frameworks: array of strings - Supported video ad frameworks (e.g., ["vpaid_2_0"]). - video_bumpers: array of objects - Configuration for video bumpers. - video_bumper_type: string - Type of video bumper (e.g., "outro", "intro"). - max_duration_secs: integer - Maximum duration of the bumper in seconds. - Example Request (Shell): $ cat placement { "placement": { "video": { "supports_skippable": false, "player_vast_version": "3.0", "playback_method": null, "max_duration_sec": 200, "maximum_number_ads": 20, "context": "mid-roll", "start_delay_secs": 30, "frameworks": [ "vpaid_2_0" ], "video_bumpers": [ { "video_bumper_type": "outro", "max_duration_secs": 30 } ] } } } $ curl -b cookies -c cookies -X POST -d @placement 'https://api.appnexus.com/placement?publisher_id=626425' - Example Response (JSON): { "response": { "status": "OK", "count": 1, "id": "11323022", "start_element": 0, "num_elements": 100, "placement": { "id": 11323022, "name": "Ad Pod Placement", "code": null, "code2": null, "code3": null, "state": "active", "cost_cpm": null, "publisher_id": 626425, "content_retrieval_timeout_ms": 0, "enable_for_mediation": true, "is_prohibited": false, "site_id": 1433875, "default_referrer_url": null, "reserve_price": null, "width": 1, "height": 1, "default_position": "unknown", "default_ ``` -------------------------------- ### Ad Profile Creation API Success Response Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup An example of a successful API response after creating an ad profile, indicating the operation's status and general details like element count and ID. This response structure is typical for successful resource creation or retrieval. ```JSON { "response" : { "start_element" : 0, "id" : 1223520, "num_elements" : 100, "status" : "OK" } } ``` -------------------------------- ### Xandr Placement and Publisher API Endpoints Source: https://learn.microsoft.com/en-us/xandr/digital-platform-api/sell-side-setup Documentation for key Xandr API endpoints related to managing placements and retrieving publisher information. It covers updating placements via PUT requests and obtaining placement IDs via GET requests to publisher data. ```APIDOC /placement API PUT /placement?id=PLACEMENT_ID - Description: Updates properties of an existing placement. - Parameters: - id (query, required): The unique identifier of the placement to be updated. - Request Body (JSON): - Example: { "placement": { "default_position": "above" // Example of a field to update // ... other updatable placement fields as per Placement Service } } - Returns: JSON object indicating success and the updated placement details. - Success Response Example: { "response" : { "status" : "OK", "id" : "13741957", "placement" : { "default_position" : "above", // ... full placement object details }, "count" : 1 } } /publisher API GET /publisher?id=PUBLISHER_ID - Description: Retrieves details for a specific publisher. This endpoint can be used to obtain the default placement ID associated with a publisher if it was not copied during creation. - Parameters: - id (query, required): The unique identifier of the publisher. - Returns: JSON object containing publisher details. The default placement ID is typically found within the publisher's associated data. ``` -------------------------------- ### Xandr Creative Preview URL Example Source: https://learn.microsoft.com/en-us/xandr/supply-partners/faq-integration-process Demonstrates how to construct a creative preview URL for video creatives by appending '&format=vast' to the base 'iurl'. This URL is static and can be used for pre-auditing or creative caching. ```URL https://fra1-ib.adnxs.com/cr?id=48265354&format=vast ``` -------------------------------- ### Example HTTP GET Request for Inventory Detail API Source: https://learn.microsoft.com/en-us/xandr/yield-analytics-api/product-and-inventory-service A raw HTTP GET request example for the Inventory Detail API, showing the request line, path parameters, and necessary headers for content negotiation and authentication. ```http GET /api/v1/rest/product/inventory/targetingcharacteristics/characteristics;city=Boulder; country=USA/2017-03-01/2017-03-01 HTTP/1.1 Content-Type: application/json Accept: application/json username: {{username}} password: {{password}} source: {{source}} Host: https://{{client_url}}/api/v1/rest ```