-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a new subscriber returns 400 Bad Request #87
Comments
To be honest, the library is woefully maintained and the payload looks like it has changed (400 is a client error). This isn't going help other than the library needs an update. The starting point is to work out which API version you are running against. I would then run the tests against that version. With that, there's the starting point for a patch. I'm sorry not to be more helpful at this point. |
Hi @joaonlforte Thanks for sharing the issue. We are working on generating SDK automatically using an open API file. All SDKs including dotnet SDK will be updated in mid Q1. Could you please use our API directly to create a subscriber |
Hey 👋 thanks both @toddb @jainpawan21 for the fast reply ;) @jainpawan21 I can sure! Do you have a more concrete date on making the revamped SDKs available? Should i keep an eye on the newsletter? Nevertheless @jainpawan21 I think the NET documentation you pointed to is misleading still here using Novu.DTO;
using Novu.Models;
using Novu;
var novuConfiguration = new NovuClientConfiguration
{
/**
* Defaults to https://api.novu.co/v1
*/
Url = "https://novu-api.my-domain.com/v1",
ApiKey = "12345",
};
var novu = new NovuClient(novuConfiguration);
var additionalData = new List<AdditionalDataDto> // DEPRECATED
{
new AdditionalDataDto
{
Key = "External ID",
Value = "1122334455"
},
new AdditionalDataDto
{
Key = "SMS_PREFERENCE",
Value = "EMERGENT_ONLY"
}
};
var newSubscriberDto = new CreateSubscriberDto
{
SubscriberId = "unique_subscriber_id",
FirstName = "John",
LastName = "Doe",
Avatar = "https://unslpash.com/random",
Email = "[email protected]",
Locale = "en-US",
Phone = "+11112223333",
Data = additionalData
};
var subscriber = await novu.Subscriber.CreateSubscriber(newSubscriberDto) |
I'm using dotnet sdk v0.3.3
and when calling
POST /v1/subscribers
the api returns a 400c# code snippet
documentation example seems to be using the same contract format
this used to work properly in the past, but we've start getting this error (can't precise exactly when)
response
The text was updated successfully, but these errors were encountered: