Comments (12)
Hey @sicoa !
- Could you provide your code and a console output with debug mode on like so ?
client.setDebug(MailjetClient.VERBOSE_DEBUG);
MailjetRequest request = new MailjetRequest(Campaign.resource)
// .filter(..., ...)
;
MailjetResponse campaign = client.get(request);
my output is :
=== HTTP Request ===
GET https://api.mailjet.com/v3/REST/campaign?
Accept-Charset:UTF-8
user-agent:mailjet-apiv3-java/v3.0.0
Accept:application/json
=== HTTP Response ===
Receive url: https://api.mailjet.com/v3/REST/campaign?
Status: 200
null:HTTP/1.1 200 OK
Date:Thu, 03 Dec 2015 10:52:25 GMT
Content-Length:41
Connection:keep-alive
Content-Type:application/json
Server:nginx
- At the moment,
filter
accepts bothString
andint
. Do you think we should addLong
andDates
back ?
when you say: "Also the documentation has remained the same as before the update, stating the previous attributes' types", are you talking about the README.md
?
Best,
Guillaume from Mailjet!
from mailjet-apiv3-java.
Thank you once more for the quick reply Mr Guillaume!
- When i said documentation, i meant the v3 reference
Regarding filters, as long as it works, i would not change them, I do like more the Int/String only values (i will try the date implementation, as date is a strange format)
My account for testing, the one i use the creds from, has 6 campaigns made.
The response i get is the same as yours but i do not get any Data:
{"Status":200,"Total":0,"Data":[],"Count":0}
Output in the console:
=== HTTP Request ===
GET https://api.mailjet.com/v3/REST/campaign?FromID=0&ContactsList=0
Accept-Charset:UTF-8
Accept:application/json
user-agent:mailjet-apiv3-java/v3.0.0
=== HTTP Response ===
Receive url: https://api.mailjet.com/v3/REST/campaign?FromID=0&ContactsList=0
Status: 200
null:HTTP/1.1 200 OK
Server:nginx
Connection:keep-alive
Content-Length:41
Date:Thu, 03 Dec 2015 11:15:48 GMT
Content-Type:application/json
Content:
{ "Count" : 0, "Data" : [], "Total" : 0 }
from mailjet-apiv3-java.
Regarding filters, what has happened to the Boolean ones? They recognize only true/false String values?
from mailjet-apiv3-java.
I assume this is your call then (?)
new MailjetRequest(Campaign.resource)
.filter(Campaign.FROMID, 0)
.filter(Campaign.CAMPAIGNID, 0);
Can you make sure you've got a sender with ID 0 and a Contact list with id 0 ?
Regarding Boolean in filters, yeah, I am definitly adding them, you are right
from mailjet-apiv3-java.
Well, i do not use any filter as my response suggests. A plain Campaign.resource call.
:)
FILTERS:
Please can you specify to me if the v3 reference is actual? I mean the filters for example.
When i call "Contact." like "request.filter(Contact.CONTACTSLIST,contlistfilter);" i have the option of filtering with many more attributes than the ones listed at the v3REFERENCE. Does it work? Do i have all those filters that are Contact stats AND filters from the old ones? Example: Contact.CAMPAIGN exists and in the previous version, meant only filter, as it is not a Contact attribute. Now it is there along with the rest of the filters AND the attributes for Contact
from mailjet-apiv3-java.
The v3 reference is up to date. The Resource propreties are actually helper for autocompletion. So they are valid for filters AND body (for POST/PUT) fields. They are just strings actually.
I tried to reproduce your error, but I can't, it is weird. This code produces this output for me:
client.setDebug(MailjetClient.VERBOSE_DEBUG);
MailjetRequest request;
MailjetResponse response;
request = new MailjetRequest(Campaign.resource);
response = client.get(request);
=== HTTP Request ===
GET https://api.mailjet.com/v3/REST/campaign?
Accept-Charset:UTF-8
Accept:application/json
user-agent:mailjet-apiv3-java/v3.0.0
=== HTTP Response ===
Receive url: https://api.mailjet.com/v3/REST/campaign?
Status: 200
null:HTTP/1.1 200 OK
Server:nginx
Connection:keep-alive
Content-Length:41
Date:Thu, 03 Dec 2015 13:13:53 GMT
Content-Type:application/json
the interesting line is GET https://api.mailjet.com/v3/REST/campaign?
Yours is GET https://api.mailjet.com/v3/REST/campaign?FromID=0&ContactsList=0
It is hard to tell where the bug comes from in the wrapper then..
from mailjet-apiv3-java.
Mr Guillaume
i am truly sorry for the frustration, i seem to have forgotten initial values at the previous implementation for those two specific stats that used to be non strings (long or int i believe)
Thank you a lot for your effort to solve the issue!
However i still cannot get the content from the campaigns:
=== HTTP Request ===
GET https://api.mailjet.com/v3/REST/campaign?
Accept-Charset:UTF-8
Accept:application/json
user-agent:mailjet-apiv3-java/v3.0.0
=== HTTP Response ===
Receive url: https://api.mailjet.com/v3/REST/campaign?
Status: 200
null:HTTP/1.1 200 OK
Server:nginx
Connection:keep-alive
Content-Length:41
Date:Thu, 03 Dec 2015 14:01:23 GMT
Content-Type:application/json
Content:
{ "Count" : 0, "Data" : [], "Total" : 0 }
from mailjet-apiv3-java.
Don't worry ;)
So the http call is working normally, now it might be related to the server. What do you get when you type in your terminal:
curl -X GET --user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" http://api.mailjet.com/v3/REST/Campaign
with the correct API credentials ?
from mailjet-apiv3-java.
Calling the url you gave me with the correct credentials, it returns exactly the same response:
{ "Count" : 0, "Data" : [], "Total" : 0 }
However i do have 6 campaigns under the CAMPAIGN tab..
What am i supposed to be looking at as a response?
One comment regarding v3reference. Apart from the change in the types of variables as we discussed before concerning Dates etc, for example i just stumbled upon
Contact Filter: Recipient Only retrieve contacts corresponding to this recipient. [ Type Int64 ] This does not exist in the Contact properties.
from mailjet-apiv3-java.
Ow, my bad, I get it now!
The request made without the FromTS filter will return all the Campaigns made today only.
Try this for all campagins from day 0:
MailjetRequest request;
MailjetResponse response;
request = new MailjetRequest(Campaign.resource)
.filter(Campaign.FROMTS, 1);
response = client.get(request);
System.out.println(response);
Again, sorry for the inconvenience!
Best,
Guillaume
from mailjet-apiv3-java.
Does it work on your side ?
from mailjet-apiv3-java.
It worked like charm Mr Guillaume!
Thank you for all your help and immediate responses
Best regards
SicoaDev
ps. Did you check my comment on Contact Filter: Recipient ? Shall i open a new issue maybe for any gaps/controversially documented parts etc that i may find?
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.