Comments (12)
Hey !
I indeed need to implement a distinction between Filters and properties in the wrapper. You cannot POST/PUT
with filters. You can see the props/filters here at the moment: http://dev.mailjet.com/email-api/v3/listrecipient/
Could you try to see the PUT
results with cUrl ? I think when you make a PUT
without changing anything, it sends a non-json 304 response, and the Wrapper does not support non-json response yet. Its actually a bug
from mailjet-apiv3-java.
Hi there sir
thank you once more for the reply
- Attribute issue
- Create issue
- Update issue
- Delete issue
I did not use filters.
from mailjet-apiv3-java.
Hey there!
Contactslist
is not a valid property: http://dev.mailjet.com/email-api/v3/listrecipient/
You can simply create a list via different endpoints:
http://dev.mailjet.com/email-api/v3/contact-managecontactslists/
http://dev.mailjet.com/email-api/v3/contact-managemanycontacts/
http://dev.mailjet.com/email-api/v3/contactslist-managecontact/
http://dev.mailjet.com/email-api/v3/contactslist-managemanycontacts/
Listrecipient is not a stable way of doing the job. We didn't even featured it in the API guide
The update is I guess a 304 error that don't send any JSON back (I need to fix that): it means that the content has not been changed because the payload was not changing anything. Can you make sure with debug logging ?
from mailjet-apiv3-java.
Greetings
some comments:
I did not understand your last reply to be honest. I was talking about Listrecipients, not ContactsList.
Although for some reason when trying to list the Listrecipients, the request shows a JSON with Contactslist for resource (issue in here no2).
Secondly, i did not understand why Listrecipientis not valid. http://dev.mailjet.com/email-api/v3/listrecipient/ : it is very clearly stated what it does. If it does not work then maybe the Reference is wrong.
Finally, in general is "delete" stated correctly as shown above?
For example when i try to delete a Contactslist :
request = new MailjetRequest(Contactslist.resource).filter(Contact.ID, id);
response=cl.delete(request);
i get the following response JSON with IsDeleted:false:
{"Status":200,"Total":1,"Data":[{"IsDeleted":false,"Address":"_____","SubscriberCount":0,"CreatedAt":"2015-12-07T10:03:29Z","ID":15___49,"Name":"test"}],"Count":1}
Thank you in advance for your reply
from mailjet-apiv3-java.
Hey @sicoa ! Sorry for the delay! :)
I have created a new branch @sicoa-fixes
that contains a fix for the delete
that now works and a fix for the JSONExceptions. The delete
was actually performing a get
..
So inside that branch this works for me:
public class Main {
public static void main(String[] args) throws MailjetException {
MailjetClient client = new MailjetClient("", "");
client.setDebug(MailjetClient.VERBOSE_DEBUG);
System.out.println("POST REQUEST");
MailjetRequest postRequest = new MailjetRequest(Listrecipient.resource)
.property(Listrecipient.ISACTIVE, true)
.property(Listrecipient.ISUNSUBSCRIBED, false)
.property(Listrecipient.LISTID, 2)
.property(Listrecipient.CONTACTID, 3);
MailjetResponse postResponse = client.post(postRequest);
System.out.println(postResponse);
Long ID = postResponse.getData().getJSONObject(0).getLong("ID");
System.out.println(ID);
System.out.println("PUT REQUEST");
MailjetRequest putRequest = new MailjetRequest(Listrecipient.resource, ID)
.property(Listrecipient.ISACTIVE, false);
MailjetResponse putResponse = client.put(putRequest);
System.out.println(putResponse);
System.out.println("DELETE REQUEST");
MailjetRequest deleteRequest = new MailjetRequest(Listrecipient.resource, ID);
MailjetResponse deleteResponse = client.delete(deleteRequest);
System.out.println(deleteResponse);
}
}
Let me know if you think about anything before I push this on master :)
Best,
Guillaume
from mailjet-apiv3-java.
Good afternoon Mr Guillaume
i am very glad to tell you that delete works fine indeed. Thank you for the efforts!
How about the rest of the questions?
Remaining yours
sicoaDev
from mailjet-apiv3-java.
What is your goal when dealing with listrecipient
?
Do you want to add a contact
to a contactslist
?
from mailjet-apiv3-java.
I am trying to create one, as i described in the first question, no2 issue
from mailjet-apiv3-java.
If you use: ContactManagecontactslists
, it will create the listrecipient
automatically
request = new MailjetRequest(ContactManagecontactslists.resource, ID)
.property(ContactManagecontactslists.CONTACTSLISTS, new JSONArray()
.put(new JSONObject()
.put("ListID", "$ListID_1")
.put("Action", "addnoforce"))
.put(new JSONObject()
.put("ListID", "$ListID_2")
.put("Action", "addforce")));
from mailjet-apiv3-java.
I see, so ListRecipient is a part being deprecated and is almost of no use right now, is that right?
from mailjet-apiv3-java.
Actually no but we wouldn't recommend our users to use it because it is
complex so we created the contactManagecontactlist wrapper around the listrecipient to make it easier
from mailjet-apiv3-java.
Ok!
Thank you once more Guillaume!
Best wishes
sicoaDev
from mailjet-apiv3-java.
Related Issues (20)
- java.lang.NoSuchMethodError: 'okio.Buffer okio.BufferedSource.getBuffer()' HOT 2
- Release 5.2.1 not tagged and not published to maven HOT 5
- Cannot access Client Options
- Constant for "Globals" missing in Emailv31. HOT 1
- Send Mail With JDK11 HttpClient? HOT 1
- CVE-2020-29582: Information exposure HOT 1
- Csvimport.DATA does not exist HOT 2
- java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto([B[BIII)[B HOT 6
- Certificate issue HOT 1
- Patch org.json:json@20220320 to fix CVE-2022-45688 HOT 1
- com.mailjet.client.errors.MailjetUnauthorizedException: Unauthorized HOT 1
- Contactstatistics: JSONException: JSONObject["Contact"] not found. HOT 2
- Message Result 'To' is null HOT 2
- Passing variables to templates does not work.
- Socket Exception HOT 2
- New vulnerability in org.json (https://nvd.nist.gov/vuln/detail/CVE-2023-5072#VulnChangeHistorySection) HOT 1
- SocketTimeoutException HOT 1
- delete customer 401 Unauthorized HOT 1
- update customer by ID 404
- Certificate Issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailjet-apiv3-java.