=========== Quick Guide =========== To start using the API you need: * an active and properly configured account on |automation|; * a configured :term:`Template app` on the |adjust| account; * working `Adjust API Token`_. For further information on initial setup please contact your Account Manager. Authorization Headers --------------------- Authorization is done by sending the token in the ``AdjustAuthorization`` header as shown in the example below. .. code-block:: bash $ curl \ --header "AdjustAuthorization: Token " \ --header "SignatureAuthorization: Token " \ ... The Adjust API Token can be obtained by visiting `Adjust Dashboard User Details Page`_. All actions are carried out on the account to which the given user token belongs to. For more information about Authorization please see :ref:`info-authorization`. Create or update an app ----------------------- First step is to create a new app in the account. For that we need to provide proper ``AdjustAuthorization`` token and the required data about the app as show in the `cURL `_ example below: .. code-block:: bash $ curl \ --header "AdjustAuthorization: Token " \ --header "Content-Type: application/json" \ --data '{ "name":"Test App Name", "bundle_id":"test.bundle.app", "store_id":"test.bundle.app", "platform":"android", "channel_setup": { "facebook": {"app_id": "123456789"} } }' \ -X POST https://settings.adjust.com/api/app This request will create a ticket on |automation| which will be worked on in the background. If everything is correct response should look like following: .. code-block:: bash { "adjust_app_token": "p77yk727r18g", "name": "Test App Name", "sk_app_id": null, "store_id": "test.bundle.app", "bundle_id": "test.bundle.app", "ticket_token": "af7702a9-ba95-6ba2-bdac-3f83e55ed8d3" } :ref:`quick-guide-get-ticket-status` can be fetched with :ref:`get-ticket-status` endpoint using the ``ticket_token`` received in the response from :ref:`post-app`. For more information about managing apps please see :ref:`info-create-new-app`. Fetch settings using Adjust app token ------------------------------------- Once the app is created on the |adjust| account we can the app settings using the adjust app token, for example: .. code-block:: bash $ curl \ --header "AdjustAuthorization: Token " \ -X GET https://settings.adjust.com/api/app/p77yk727r18g And the response should contain all the data |automation| has for the app: .. code-block:: bash { "name" : "Test App Name", "adjust_app_token" : "p77yk727r18g", "platform" : "android", "store_id" : "test.bundle.app", "channel_setup" : { "facebook" : { "app_id" : "123456789" }, "snapchat" : { "app_id" : "test.bundle.app" } }, "additional_info" : { "overrides" : {} } } For more information please see :ref:`get-app-adjust_app_token`. Fetch settings using Store ID and Platform ------------------------------------------ .. code-block:: bash $ curl \ --header "AdjustAuthorization: Token " \ -L -X GET 'https://settings.adjust.com/api/app?store_id=test.bundle.app&platform=android' # response is app details For more information please see :ref:`get-app-store_id_platform`. Create Campaign Tracker URLs ---------------------------- .. code-block:: bash $ curl \ --header "AdjustAuthorization: Token " \ --header "Content-Type: application/json" \ --data '{ "store_id": "test.bundle.app", "platform": "ios", "channel": "unityads" }' \ -X POST https://settings.adjust.com/api/campaign # response is tracker URLs For more information please see :ref:`post-campaign`. .. _quick-guide-get-ticket-status: Ticket status ------------- Once the app creation or update were requested the status of the background jobs can be tracked using :ref:`get-ticket-status` endpoint. In the response JSON, key ``status`` is used to describe the status of the current ticket. If status is ``completed`` or ``failed`` all the jobs have been finished. Any other status means the ticket is still being processed. Response will be in format similar to this:: { "status" : "completed", "events": { "successes": [ ], "failures": [ ], }, # if a section migration has failed before we started migration process, # the reponse structure will contain details about the error "partners": { "section": "partners", "detail": "Could not be start, because {events} sections has failed" } }