· 6 years ago · Jan 08, 2020, 12:14 PM
1$ curl --include \
2> --request POST \
3> --header "Content-Type: application/json; charset=utf-8" \
4> --header "Authorization: Basic MWE5ZTNkNTYtMTI5NC00MGQ3LWEwZjQtZmU4NDYzZWJjYzlm" \
5> --data-binary "{\"app_id\": \"27826cea-3e14-4656-ade0-e510c596b1b3\",
6> \"contents\": {\"en\": \"English Message\", \"ar\": \"Arabic Message\"},
7> \"data\": {},
8> \"ios_category\": \"coupon_expire\",
9> \"filters\": [{\"field\": \"tag\", \"key\": \"phoneNumber\", \"relation\": \"=\", \"value\": \"+9660512312312\"}]}" \
10> https://onesignal.com/api/v1/notifications
11 % Total % Received % Xferd Average Speed Time Time Time Current
12 Dload Upload Total Spent Left Speed
13100 486 0 231 100 255 1110 1225 --:--:-- --:--:-- --:--:-- 2347HTTP/2 400
14date: Wed, 08 Jan 2020 12:10:56 GMT
15content-type: application/json; charset=utf-8
16set-cookie: __cfduid=d40fed9ee90661b00b38480a6d445bf611578485456; expires=Fri, 07-Feb-20 12:10:56 GMT; path=/; domain=.onesignal.com; HttpOnly; SameSite=Lax
17status: 400 Bad Request
18cache-control: no-cache
19access-control-allow-origin: *
20referrer-policy: strict-origin-when-cross-origin
21x-xss-protection: 1; mode=block
22x-request-id: cb9634a4-87da-4595-846d-94701cba5fc4
23access-control-allow-headers: SDK-Version
24x-runtime: 0.005538
25x-frame-options: SAMEORIGIN
26x-content-type-options: nosniff
27x-powered-by: Phusion Passenger 5.3.7
28cf-cache-status: DYNAMIC
29expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
30server: cloudflare
31cf-ray: 551e123808c1f290-WAW
32
33{"errors":["Please include a case-sensitive header of Authorization: Basic \u003cYOUR-REST-API-KEY-HERE\u003e with a valid REST API key."],"reference":["https://documentation.onesignal.com/docs/accounts-and-keys#section-keys-ids"]}