Error When i copy items
When i try to copy items using java client, I take this error when the field is contact. Can you help me?
Exception in thread "main" APIException [status=Bad Request, error=invalid_value, description=Invalid value {"city": "Thessaloniki", "user_id": 3118836, "name": "kostas Loizidis", "rights": ["view", "delete", "update"], "country": "Greece", "space_id": null, "profile_id": 170940017, "org_id": null, "birthdate": "1984-01-09", "phone": ["00306977590921", "00302310853548"], "type": "user", "link": "https://podio.com/users/3118836", "avatar": 186683601, "image": {"hosted_by": "podio", "hosted_by_humanized_name": "Podio", "thumbnail_link": "https://d2cmuesa4snpwn.cloudfront.net/public/186683601", "link": "https://d2cmuesa4snpwn.cloudfront.net/public/186683601", "file_id": 186683601, "link_target": "_blank"}, "skype": "kostasloizidis", "mail": ["kostasloizidis@hotmail.com"], "title": ["Software Developer"], "external_id": null, "last_seen_on": "2015-10-14 15:00:26", "address": ["Doiranis 32"]} (object): must be integer or must be integer or missing required properties: ['id'], parameters=null]
at com.podio.ExceptionFilter.handle(ExceptionFilter.java:27)
at com.sun.jersey.api.client.Client.handle(Client.java:652)
at com.podio.LoginFilter.handle(LoginFilter.java:28)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:560)
at com.podio.item.ItemAPI.addItem(ItemAPI.java:47)
at mainClasses.MainClass.copyItems(MainClass.java:176)
at mainClasses.MainClass.copyApplication(MainClass.java:137)
at mainClasses.MainClass.copyWorkspaces(MainClass.java:48)
at mainClasses.MainClass.main(MainClass.java:34)
-
public ClientResponse handle(final ClientRequest request) throws ClientHandlerException {
Map<String, Object> effectiveProperties =
new HashMap<String, Object>(properties);
effectiveProperties.put(Client.class.getName(), this);
effectiveProperties.putAll(request.getProperties());
request.setProperties(effectiveProperties);final ClientResponse response = getHeadHandler().handle(request); response.getProperties().put(Client.class.getName(), this); return response; }
The error is caused when the command final ClientResponse response = getHeadHandler().handle(request); is executed
-
public ClientResponse handle(ClientRequest cr) throws ClientHandlerException { try { ClientResponse response = getNext().handle(cr); if (response.getClientResponseStatus() == null || response.getClientResponseStatus().getFamily() != Family.SUCCESSFUL) { Map<String, Object> errorData = response .getEntity(new GenericType<Map<String, Object>>() { }); throw new APIApplicationException( response.getClientResponseStatus(), (String) errorData.get("error"), (String) errorData.get("error_description"), (Map<String, Object>) errorData.get("parameters")); } else { return response; } } catch (ClientHandlerException e) { throw new APITransportException(e.getCause()); } }
and throw APIApplicationException
Please sign in to leave a comment.
Comments
5 comments