From c35fe54d93cef02470c049b7b3fbdf128cedc22d Mon Sep 17 00:00:00 2001 From: Spencer Kaiser Date: Tue, 13 Dec 2022 15:34:15 -0600 Subject: [PATCH 1/2] Updating docs to include content-type header --- docs/rest-api/Authentication.md | 7 ++++++- .../create-a-cron-job.md" | 7 ++++++- .../get-cron-job-info.md" | 5 ++++- docs/rest-api/Events/create-event.md | 7 ++++++- docs/rest-api/Events/get-event-info.md | 5 ++++- docs/rest-api/Events/get-many-events.md | 5 ++++- docs/rest-api/Events/update-event.md | 7 ++++++- 7 files changed, 36 insertions(+), 7 deletions(-) diff --git a/docs/rest-api/Authentication.md b/docs/rest-api/Authentication.md index 8abc619..6a94530 100644 --- a/docs/rest-api/Authentication.md +++ b/docs/rest-api/Authentication.md @@ -27,7 +27,12 @@ const createEvent = async () => { values: ["eggs", "bacon", "pasta", "bread"], }), }, - { headers: { "x-api-key": "YOUR_API_KEY" } } + { + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, + } ); console.log("Event created 🎉", data); diff --git "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/create-a-cron-job.md" "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/create-a-cron-job.md" index 4c9b827..0ab8e31 100644 --- "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/create-a-cron-job.md" +++ "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/create-a-cron-job.md" @@ -69,7 +69,12 @@ const createCronJob = async () => { values: ["eggs", "bacon", "pasta", "bread"], }), }, - { headers: { "x-api-key": "YOUR_API_KEY" } } + { + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, + } ); console.log("Cron Job created 🎉", data); diff --git "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-cron-job-info.md" "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-cron-job-info.md" index fea2c89..8fe8f80 100644 --- "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-cron-job-info.md" +++ "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-cron-job-info.md" @@ -58,7 +58,10 @@ const apiBaseUrl = "https://app.jiter.dev/api"; const getCronJob = async () => { try { const { data } = await axios.get(`${apiBaseUrl}/cronjobs/9`, { - headers: { "x-api-key": "YOUR_API_KEY" }, + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, }); console.log("Cron job found 🎉", data); diff --git a/docs/rest-api/Events/create-event.md b/docs/rest-api/Events/create-event.md index 02d78dd..81fb48c 100644 --- a/docs/rest-api/Events/create-event.md +++ b/docs/rest-api/Events/create-event.md @@ -64,7 +64,12 @@ const createEvent = async () => { values: ["eggs", "bacon", "pasta", "bread"], }), }, - { headers: { "x-api-key": "YOUR_API_KEY" } } + { + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, + } ); console.log("Event created 🎉", data); diff --git a/docs/rest-api/Events/get-event-info.md b/docs/rest-api/Events/get-event-info.md index 82ad98c..cd6f969 100644 --- a/docs/rest-api/Events/get-event-info.md +++ b/docs/rest-api/Events/get-event-info.md @@ -52,7 +52,10 @@ const apiBaseUrl = "https://app.jiter.dev/api"; const getEvent = async () => { try { const { data } = await axios.get(`${apiBaseUrl}/events/47`, { - headers: { "x-api-key": "YOUR_API_KEY" }, + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, }); console.log("Event found 🎉", data); diff --git a/docs/rest-api/Events/get-many-events.md b/docs/rest-api/Events/get-many-events.md index b8476c0..6b31b80 100644 --- a/docs/rest-api/Events/get-many-events.md +++ b/docs/rest-api/Events/get-many-events.md @@ -70,7 +70,10 @@ const getManyEvents = async () => { try { const { data } = await axios.get(`${apiBaseUrl}/events?${query}`, { - headers: { "x-api-key": "YOUR_API_KEY" }, + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, }); console.log("Events found 🎉", data); diff --git a/docs/rest-api/Events/update-event.md b/docs/rest-api/Events/update-event.md index 75e68a5..a2c3b78 100644 --- a/docs/rest-api/Events/update-event.md +++ b/docs/rest-api/Events/update-event.md @@ -72,7 +72,12 @@ const updateEvent = async () => { }), status: "Cancelled", }, - { headers: { "x-api-key": "YOUR_API_KEY" } } + { + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, + } ); console.log("Event updated 🎉", data); From d69b1a98c89d131c24e52ccb0d02254353306f93 Mon Sep 17 00:00:00 2001 From: Spencer Kaiser Date: Wed, 14 Dec 2022 15:22:12 -0600 Subject: [PATCH 2/2] More references --- .../get-many-cron-jobs.md" | 5 ++++- .../Cron Jobs \342\232\240\357\270\217/update-cron-job.md" | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-many-cron-jobs.md" "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-many-cron-jobs.md" index fe5df3a..9ec32e3 100644 --- "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-many-cron-jobs.md" +++ "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/get-many-cron-jobs.md" @@ -51,7 +51,10 @@ const apiBaseUrl = "https://app.jiter.dev/api"; const getManyCronJobs = async () => { try { const { data } = await axios.get(`${apiBaseUrl}/cronJobs`, { - headers: { "x-api-key": "YOUR_API_KEY" }, + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, }); console.log("Cron jobs found 🎉", data); diff --git "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/update-cron-job.md" "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/update-cron-job.md" index 69b4f3e..2e16b6d 100644 --- "a/docs/rest-api/Cron Jobs \342\232\240\357\270\217/update-cron-job.md" +++ "b/docs/rest-api/Cron Jobs \342\232\240\357\270\217/update-cron-job.md" @@ -71,7 +71,12 @@ const updateCronJob = async () => { { status: "Disabled", }, - { headers: { "x-api-key": "YOUR_API_KEY" } } + { + headers: { + "x-api-key": "YOUR_API_KEY", + "Content-Type": "application/json", + }, + } ); console.log("cron job updated 🎉", data);