-1

I was trying to run twilio quickstart code for programmable chat, but I was getting the below error.

Logging in... There was an error creating the chat client: Error: Fetch resource from "Client/v1/Configuration" failed. Please check your .env file.

configurations seems proper in Twilio Server Starter Kit Environment Setup.

enter image description here

enter image description here

Adding Few more information as requested.

I don't have a code for now, I am testing my api for conversation using postman, I am trying to read the the list of messages using postman, but I get authentication error, just wanted to know the format of request body to pass the credential.

enter image description here

philnash
  • 70,667
  • 10
  • 60
  • 88
Ashwin
  • 3
  • 3
  • Are you seeing any errors in the terminal where the server is running? (As a note, the [programmable chat service is being sunset in July](https://www.twilio.com/changelog/programmable-chat-end-of-life) and you should use the [Conversations API](https://www.twilio.com/docs/conversations) instead. – philnash Mar 02 '22 at 00:31
  • Thanks..! In that can you please send me any reference quickstart project from twilio for using conversation api, I am planning to have front end in angular and the server in C#.net for my chat application, any reference example will make my job easier... – Ashwin Mar 04 '22 at 04:25
  • I linked to the documentation, there are quick start applications there, I'm sure you can find them. – philnash Mar 04 '22 at 04:27
  • Thanks @philnash, that helped, I could create a conversation, add participants and send messages, but when i try to retrieve the list of message sent, I get unauthorized response, can you please let me know what is the format I should pass my authorization, url -https://conversations.twilio.com/v1/Conversations/CHXXXXX/Messages body - { "Authorization": "ACXXXXXXXXXXX:eXXXXXXXXXXX" } response - , "detail": "Your AccountSid or AuthToken was incorrect.", "message": "Authentication Error - No credentials provided", "status": 401 – Ashwin Mar 07 '22 at 13:01
  • Can you update your question with the full code you're using? I can use that to write a proper answer for you. – philnash Mar 07 '22 at 22:12
  • @philnash, added the requested information, can you please check – Ashwin Mar 10 '22 at 14:01

1 Answers1

0

To authenticate the API request properly in Postman you need to add your Account SID and Auth Token (or API Key and secret) as the username and password for Basic Auth under the Authorization tab.

enter image description here

philnash
  • 70,667
  • 10
  • 60
  • 88