Discussions

Ask a Question

Upload Contacts csv via API - Getting Request Failed with status code UnsupportedMediaType

I am aple to upload a CSV file using the API Reference page, but when I use the same code in my c# application I get "Request failed with status code UnsupportedMediaType" Code below. The file is found and is the same file that works if I use the API reference page interactively. Any suggestions? (I tried a few variations - commented out below) ``` async Task UploadFileToEverbridge(string contactsFilePath,string contactsFileName, string outputFileFulePath, Logger logger) { try { contactsFilePath = contactsFilePath +@"\"; //add the slash logger.Info(contactsFilePath + contactsFileName); var options = new RestClientOptions("https://api.everbridge.net/rest/contacts/(org redacted)?uploadMethod=WITH_RECORD_TYPE"); var client = new RestClient(options); var request = new RestRequest(""); request.AlwaysMultipartFormData = true; request.AddHeader("accept", "application/JSON"); request.FormBoundary = "---011000010111000001101001"; request.AddHeader("authorization", "Basic (creds redacted)); request.AddFile("file",outputFileFullPath); //request.Addfile("file", outputFileFullPath,ContentType.Plain) //also tried this //request.AddFile("file", "Replace.csv"); //original line from API Reference Page var response = await client.PostAsync(request); logger.Info("Server Response:", response.Content); } catch (Exception ex) { logger.Error(ex.Message); } } ``` }
ANSWERED

GET /users

Hello. Anny plans to add additional parameters to pull users using this call? We should have the option of requesting users with apiAccess, search for users with a specific ssoUserId. Right now I would need to pull thousands of users just to get the one with the specific SSO user Id.. given that the ssoUserId needs to be unique, it should also be something which can be used to query, instead of having to look for it across thousands of user records. Thank you.
ANSWERED

To delete a contact from a group.

I am trying to delete a contact from a group and this is how I am going about it. ``` await client.DeleteAsync($"groups/{organizationId}/contacts?groupId={groupId}&contactIds={contact.ID}"); ``` I am getting a 400 bad request error. I have also tried the following call and it still fails ``` await httpClient.DeleteAsync($"groups/{organizationId}/contacts/{groupId}/{contactId}"); ``` What am I missing and what is the change I need to make the request?
ANSWERED

Difference between types of messages and use cases for each.

Can you explain the difference between messages, notifications and incidents? Why would you use one vs. another.
ANSWERED
ANSWERED

ReceiveEndPoints for an incident

Is there any way to get the receiveEndPoints for an incident through the API? They are currently returned in the notifications but not for incidents. ``` "receiveEndPoints": [ {"receiveUrl": "https://webserver/api/EverbridgePost/Alert", "transportProtocol": "HTTPS", "credential": { "userName": "******", "password": "******" } ] ```
ANSWERED

Can I use the developer portal to test API methods if I use api.everbridge.eu?

Absolutely! Simply change the Base URL. ![](https://files.readme.io/eedd132-image.png)
ANSWERED

How to use this Developer Portal?

Please see section [make an api call using this developer portal](https://developers.everbridge.net/home/docs/ebs-gs-guide#3-make-an-api-call-using-this-developer-portal) within the [Getting Started Guide](https://developers.everbridge.net/home/docs/ebs-gs-guide) Note: This only applies to the categories with \* next to it. When you expand the category, the end points showing the verb (GET/POST/PUT/DELETE) are the ones which can be used to send API calls using this portal ![](https://files.readme.io/d418fe5-image.png)