marcgott 1 Posted June 22, 2015 Report Share Posted June 22, 2015 Here's the setup: I have a custom module: PortfolioPortfolio has a custom field: c_buyer (Alias to Accounts records)c_buyer is a Lookup field for Accountsc_buyer stores the nameId of the account When performing an api call: Portfolio/by:c_buyer=First Last_ID There is a space, which is badly interpreted and returns a 404 %20 does not work+ does not work I have not been able to determine where/how to urldecode() the space Quote Link to post Share on other sites
X2Raymond 164 Posted June 22, 2015 Report Share Posted June 22, 2015 Encoding the space using %20 should work. Please double check to ensure there aren't any extra characters in the URI, and that and it ends in ".json". Also, custom attributes are prefixed with "c_" when stored internally, and hence must be prefixed in the same way when specifying criteria in the API. If you need to filter on multiple attributes, they must be separated by a semi colon character ( For example, a similar query to retrieve the Contacts whose company is Example Co. expects the URL to be formatted as follows: curl -u admin:admin --header "Content-Type:application/json" http://localhost/index.php/api2/Contacts/by:company=Example%20Co._33.json Quote Link to post Share on other sites
marcgott 1 Posted June 22, 2015 Author Report Share Posted June 22, 2015 Correct again! It was the .json suffix that was missing. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.