Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Curl command to create incident

Diane Todea September 2, 2021

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 2, 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"
Diane Todea September 3, 2021

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 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
AUG Leaders

Atlassian Community Events