InterNetX / java-domainrobot-sdk

A maven package for easy integration of the Domainrobot API powered by InterNetX GmbH.
MIT License
1 stars 4 forks source link

Contact.list E-Mail address is empty #10

Closed andlinger closed 4 years ago

andlinger commented 4 years ago

With a GET call the address is sent. It is missing in a LIST call.

Ephenodrom commented 4 years ago

@andlinger Every list task will return only some information of an entity. You have to add specific queryParameters, so the api will return more information for each entity.

You have to add a queryParemeter "keys[]" for each extra field to return. The list of supported field can be found on the code documentation for each list() method.

Please update to the latest release to use this functionality.

Take a look at this example on how to handle the queryParameters.

        String user = "";
        String password = "";
        String context = "";
        String baseUrl = "";
        Domainrobot sdk = new Domainrobot(user, context, password, baseUrl);
        List<Contact> contacts = null;
        Map<String, Object> queryParameters = new HashMap<String, Object>();

        List<String> fields = new ArrayList<String>();
        fields.add("email");
        fields.add("phone");

        queryParameters.put("keys[]", fields);
        queryParameters.put("foo", "bar");
        try {
            contacts = sdk.getContact().list(null, null, queryParameters);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(contacts);