Discussions
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);
}
}
```
}
Posted by A 11 months ago
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.
Posted by John P 11 months ago
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?
Posted by John Dykes 11 months ago
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.
Posted by A. Watson about 1 year ago
Groups api call for ITA
I've submitted an enhancement request for this, but I think it's worth mentioning here.
We strongly recommend that the group API call be enhanced to provide query functionality. It should not be necessary to pull all the groups from an organization, loop through them and discard most of them to pull certain groups from the list.
Pulling 4993 groups and discarding most of them to get the 50 groups I need?
When we need to service a REST request to target a selection of groups, pulling all the groups and filtering them results in API calls timing out. It's a big problem when one needs to provide this functionality to integrations when many integrations may be running at the same time. Pulling all the groups and storing them in some database presents its own set of problems, as there is no facility from the product that can inform a service that some group has changed.
At minimum, the groups API should be able to return the groups which are using a certain calendarID, the group name starts-with/ends-with a string or return those groups which share a parentId.
Thanks!
Posted by JohnP about 1 year ago
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": "******"
}
]
```
Posted by UMMC DIS about 1 year ago
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)
Posted by [email protected] over 1 year ago
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)
Posted by [email protected] over 1 year ago