Giter Site home page Giter Site logo

Create app API about api HOT 5 CLOSED

Kalo2412 avatar Kalo2412 commented on September 18, 2024
Create app API

from api.

Comments (5)

nan-li avatar nan-li commented on September 18, 2024 1

Hi @Kalo2412, apologies, I misunderstood the question, thank you @Hantex9 for your followup.

Yes, if you do not see the necessary keys, please reach out to our support team at [email protected] to enable elevated permission for your account.

from api.

nan-li avatar nan-li commented on September 18, 2024

Hi @Kalo2412, in order to create a new application, you need an elevated permission.
You need to use the User Auth Key instead of the REST API Key.

This is noted in the API documentation, see the link for how to get your User Auth Key.

Requires your OneSignal User Auth Key, available in Account & API Keys.

from api.

Kalo2412 avatar Kalo2412 commented on September 18, 2024

Here is a snippet, the app is created successfully but in the response the REST API Key for the newly created app is null


def onesignal():
url = "https://api.onesignal.com/apps"
payload = {
"name": "Test New App",
"organization_id": "",
"apns_key_id": "
",
"apns_team_id": "",
"apns_bundle_id": "or
***pp",
"apns_p8": "
"
}
headers = {
"accept": "text/plain",
"Content-Type": "application/json",
"Authorization": "Basic here I am using the User Auth Key"
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
key = data.get('basic_auth_key')
print(key)

The id is null. As per the doc the sample response is as following:


{
id: "e4e87830-b954-11e3-811d-f3b376925f15",
name: "Your app 1",
players: 0,
messageable_players: 0,
updated_at: "2014-04-01T04:20:02.003Z",
created_at: "2014-04-01T04:20:02.003Z",
organization_id: "551731e5-dbd5-4471-a222-2e6ae31aee31",
gcm_key: "a gcm push key",
chrome_web_origin: "Chrome Web Push Site URL",
chrome_web_default_notification_icon: "http://yoursite.com/chrome_notification_icon",
chrome_web_sub_domain:"your_site_name",
apns_env: "production",
apns_certificates: "Your apns certificate",
safari_apns_certificate: "Your Safari APNS certificate",
safari_site_origin: "The homename for your website for Safari Push, including http or https",
safari_push_id: "The certificate bundle ID for Safari Web Push",
safari_icon_16_16: "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/16x16.png",
safari_icon_32_32: "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/[email protected]",
safari_icon_64_64: "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/[email protected]",
safari_icon_128_128: "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/128x128.png",
safari_icon_256_256: "http://onesignal.com/safari_packages/e4e87830-b954-11e3-811d-f3b376925f15/[email protected]",
site_name: "The URL to your website for Web Push",
basic_auth_key: "NGEwMGZmMjItY2NkNy0xMWUzLTk5ZDUtMDAwYzI5NDBlNjJj"
}


Here the basic auth key is not null

from api.

Hantex9 avatar Hantex9 commented on September 18, 2024

Hi @Kalo2412, I also encountered the same issue with my app automation process on OneSignal. After contacting OneSignal support, I discovered they removed the "basic_auth_key" field from the response for security reasons. To see this key in the response, the admin email associated with the user auth token calling the "createApp" API needs to be whitelisted. In my case, OneSignal support added my email to the whitelist through the support ticket I opened. After that, the "basic_auth_key" field was populated in the response.

from api.

Kalo2412 avatar Kalo2412 commented on September 18, 2024

Thank you very much, all! I will contact the support! Nice day!

from api.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.