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?
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.