Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Curl command to create incident

Hi,

I'm currently testing the curl command to create a new incident and with the example you provided it's not possible. I need to format it on one line to pass it through terminal. 

I was successful to use curl get, so I know my access key and page ID are correct.

Can you confirm one line format curl to create new incident? 

1 answer

0 votes
Charlie Misonne Community Leader Sep 02, 2021

Hi Diane, welcome to the Atlassian Community,

On this page  you will find an example of a curl request to create an incident in statuspage.

I'm not sure why you need this to be on 1 line but in the example you must know that the backslashes are meant to put the single command on multiple lines in order to make that more readable. So the one line command becomes this by removing backslashes:

curl https://api.statuspage.io/v1/pages/{page_id}/incidents -H "Authorization: OAuth your-api-key-goes-here" -X POST "incident[name]=string" -d "incident[status]=string" -d "incident[body]=string"

Hi Charlie,

 

So the one line curl command seems to work in my case, I'm testing it via terminal. I also added the component, statue a d body. I can successfully create new incidents.

Please add some examples in the developer documentation as everyone is complaining about that.

Thanks. 

Charlie Misonne Community Leader Sep 03, 2021

Hi Diane,

Let me repeat what I tried to explain earlier, I hope you'll understand what I mean and can pass this information to everyone.

A backslash at the end of a line will ignore the line ending. So a multi-line command where every line ends with a backslash is actually a single line command.
And that's exactly what the statuspage documentation does.

What you are asking is to add the same example without the backslashes in the documentation. This would just duplicate the example and it doesn't make much sense.

Please be aware that this is the Atlassian Community where mostly volunteers answser questions. We are not able to change Atlassian's documentation.
If you see mistakes in the documentations you should contact Atlassian directly.
But in this case there is not mistake, you just need to understand how backslashes work in a shell.

May I ask what you get when you enter the curl command like it has been documented in the documentation? (with multi-lines and backslashes).
When I execute it I get this which seems perfectly fine:

2021-09-03 10_50_04-MINGW64__c_Users_CMOAR99.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Statuspage

New feature: Slack notifications for Statuspage

We're excited to announce the release of a long-requested feature on Statuspage. Now visitors to your status page can subscribe to get notified in Slack when you report an incident or maintenance. Th...

2,422 views 6 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you