Publish/Unpublish story C#

Hi,

I’m using Management API in my system. I was trying to call Publish/Unpublish story in my code, using code example for C# from Management API Documentation page, but I keep getting this error, although story becomes published/unpublished correctly:

{“status”:500,“error”:“Internal Server Error”}

Also, Postman call is working correctly and I’m getting 200 response.

This is the code example, I’ve just replaced URL and AUTH_TOKEN in my code:

var client = new RestClient(“https://mapi.storyblok.com/v1/spaces/606/stories/2141/publish”);
var request = new RestRequest(Method.GET);
request.AddHeader(“Authorization”, “YOUR_OAUTH_TOKEN”);
IRestResponse response = client.Execute(request);

Any help?

Thanks,
Andjela

Hello @andjela.dankic,

we tested the code but this didn’t cause any errors on our side. Can you give us the space id of the space in which you’re working and the id of the story that you’re worked on when the 500 error appeared, please?

In case that you don’t want to share that information, you can also get in touch with us in our support chat. You can click on the widget in the red square and leave us a message:

Best regards
Hannes