Unable to execute Create ticket API

Hi,

I am getting the following error when i try to call the create ticket API from a bot flow. Please help,

https://debangdas.freshdesk.com/api/v2/tickets

I used Key as “Authorization” and Value as my API key

For the description i used

‘{ “description”: “Details about the issue…”, “subject”: “Support Needed…”, “email”: “debangana.das@gmail.com”, “priority”: 1, “status”: 2 }’

I get the following error

“code”: “invalid_credentials”,

"message": "You have to be logged in to perform this action."

@deb_das,
Good Day!
I hope the API key which you are used is wrong / the format is wrong,
possible can you please share your code snippet?

Thanks

{
“description”: “Details about the issue…”,
“subject”: “Support Needed…”,
“email”: “debangana.das@gmail.com”,
“priority”: 1,
“status”: 2
}

Hey @deb_das

In the header, the value for “Authorization” must be “Basic APIkey:X” where APIkey:X must be Base64-encoded.
E.g. if your API key is W25uOtAmhj8V8zT9JJHh, then you must encode W25uOtAmhj8V8zT9JJHh:X to base64, resulting in: “VzI1dU90QW1oajhWOHpUOUpKSGg6WA==”. Then you pass in the header:

Authorization: Basic VzI1dU90QW1oajhWOHpUOUpKSGg6WA==

You can use this tool to encode it: https://www.base64encode.org/

2 Likes

Hi,
Thanks for the help. Now it works. I have now modified my code to include dynamic placeholders

But when I execute the flow then Dialog 2.3(the last statement before triggering create ticket api) gets executed again after creating the ticket in freshdesk and then in the Team Inbox in Freshchat i see that the bot has failed due to unexpected error.

I also want the ticket id created to be displayed in the chat, please help.

@deb_das,

It’s very difficult to help you in this case, since there’s a lot of variables in a Freddy Self Service flow. We would need to see your flow, flow actions, flow conversation logs, in order to try to help you.
Perhaps you can find out what’s happening reading the documentation: Freddy Self-service : Freshdesk
Or you could write to support@freshchat.com to get specialized help.

1 Like