Neto API Limitations - e-commerce

I'm currently attempting to integrate with the Neto Ecommerce API. I've hit all sorts of limitations that I never see on other platforms and the latest is to do with custom fields.
The API Im using is the GetOrders API, and Im following the requirements to fetch transaction information, however custom fields appear to be missing. Hoping someone out there has made use of this API to extract custom fields and can advise on how to go about getting custom field information.
Any tips appreciated
var netoString = '{"Filter":{"OrderID":[""],"OutputSelector":["ID","ShippingOption","DeliveryInstruction","RelatedOrderID","cust1"]};
Is there an undocumented naming convention used to fetch custom fields or other pattern I can try to see if I can fetch the data?

I am not certain this will be the same for the API, but when using exports the correct format to access Custom Sales Order Fields is "customer_ref1".
To get a Custom Customer Fields is "usercustom1"
Note: For the Custom Customer Fields, the numbers do not match up correctly (I.E. usercustom1 doesn't match misc1 in the cpanel). The correct matches are:
misc1=usercustom1
misc2=usercustom4
misc3=usercustom5
misc4=usercustom6
misc5=usercustom7
misc6=usercustom11
misc7=usercustom12
misc8=usercustom13
misc9=usercustom14
misc10=usercustom15
misc11=usercustom16
misc12=usercustom17
misc13=usercustom18
misc14=usercustom19
misc15=usercustom20
misc16=usercustom21
misc17=usercustom22
misc18=usercustom23
misc19=usercustom24
misc20=usercustom25
misc21=usercustom10
misc22=usercustom26
misc23=usercustom27
misc24=usercustom28
misc25=usercustom29
misc26=usercustom30
misc27=usercustom31
misc28=usercustom32
misc29=usercustom33
misc30=usercustom34
misc31=usercustom35
misc32=usercustom36
misc33=usercustom37
misc34=usercustom38
misc35=usercustom39
misc36=usercustom40

Related

Algolia vue-instantsearch : disjunction between two distincts facets

Using algolia vue-instantsearch, i’m encountering a special case and i’m having an hard time finding a solution.
Refinement behaviors is that you get the results that matches all your refinement filters.
If i filter on a brand and a price, i’ll get the results that matches both the brand and the price.
I need to add some specific filters that work differently. I would like to be able to say “returns me the results that matches either refinementA, or refinementB, or refinementC.”
The reason is that those refinements are checking fields that are not present on all the products.
If i check a value for refinementA, i want to keep all the results that has no value for field corresponding to refinementA, but remove those that has a value for refinementA that does not match with the one i filtered one.
Im thinking about handling myself some inputs instead of ias-components, and modifying by hand each query that is send to algolia by checking the value of my own inputs when searchFunction is triggered (https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/#widget-param-searchfunction).
I did not found yet how i can trigger a search from an non-vue-instantsearch input event, and i’m not sure how the above solution could affect the internal working of vue-instantsearch.
I’m looking for feedbacks about a more standard way of doing this, or for any advices !
I got the answer by exchanging with a vue-instantsearch maintainer.
vue-instantsearch does not provide any option to do it.
A workaround is to overwrite algoliasearch search method, that is used under the hood by vue-instant-search.
const client = algoliasearch('', '');
const originalSearch = client.search;
client.search = function search(queries) { ... }
More informations in this github issue : https://github.com/algolia/vue-instantsearch/issues/1102

How to filter with "_links" properties params on API.v3 in openproject

I just learned to use "hypermedia rest API" on openproject
I want to use "filter" param with "_links" properties on API but not know-how
Example:
http:/<my_domain>/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}, "_links":{"type":{"title":{"operator":"=","values":["Box"]}}}]
==> My Question:
i not known use to "_links":{"type":{"title":{"operator":"=","values":["Box"]} params filter. Now, result is not filter for "_links"
And show me books name to learn API for to beginner
? (https://www.oreilly.com/library/view/restful-web-clients/9781491921890/ch04.html#callout_hal_clients_CO1-1) -> is this ok?
Help me, please!
Thanks!
Image for my api
What I understood you wanting to achieve is getting all work packages in the project "design" that have been updated last within a certain time interval and that are of the type "Box".
The filters in OpenProject do not differentiate between native properties (like updatedAt) and linked resources (like type) when it comes to the structure of the filters. The syntax is always
{"<name of the filter>": {"operator": "<operator>": "values": [<list of values>]}}
When it comes to the filter values however, there is a difference. For linked resource the client is expected to use the id whereas native value like an integer, string or date is required for the native properties.
For your request the above requires the client to issue the following query:
GET http://domain/target/api/v3/projects/design/work_packages?filters=[{"updatedAt":{"operator":"<>d","values":["2017-06-10T22:00:00Z","2017-07-05T22:00:00Z"]}}, {"type":{"operator":"=", "values":["10"]}}]
I took the id of 10 for the type "Box" out of the screenshot you provided.
To get the filter values of all available filter you can call
POST http://domain/target/api/v3/queries/form
with a body of
{"name":"default","_links":{"project":{"href":"/api/v3/projects/design"}}}
The response will list all available filters in the _embedded/schema/_embedded/filtersSchema array.

How do I use the query parameters in the Dark Sky Forecast API ?(forecast.io)

I'm using the Dark Sky Forecast API to retrieve some weather information.
When I read the official doc, I found that the "option" section describes the usage of query parameters.
For example,
The API request may optionally be modified through the use of query parameters. It will respond to the following:
callback=[callback]: Return the API response as JSONP. Please use
caution when using this, since exposing your API key to the public is
a security hazard and, if abused, will result in the revokation of
your API key. However, if developing a personal- or internal-use app,
this is a convenient method of doing so.
units=[setting]: Return the
API response in units other than the default Imperial units. In
particular, the following settings are possible:
us: The default, as outlined above.
si: Returns results in SI units. In particular, properties now have the following units:
...
I know how to get the weather information by take advantages of the call
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE
But I don't know how to combine the query parameters with it.
Any ideas?
2015/10/23 UPDATE
Thank to Logan Kearns, using ? parameter solved my question. Make sure the query parameters are in lowercase.
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE?lang=zh-tw&units=si
This is how you change the units. I assume that other query parameters would be set in a similar manner, using the '?' to separate them.
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE?UNITS=us
Just an update, since url changed and with few other parameters:
You can add units to mention the type of unit conversion required
You can add exclude for excluding certain data in the response like hourly updates.
https://api.darksky.net/forecast/APIKEY/LAT,LONG?units=si&exclude=minutely,hourly,daily,alerts

YouTrack rest api - Get fields metadata

I want to create issues with the youtrack rest api,
Currently I'm using:
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
but I want to set other fields (priority, type, subsystem...)
How do I get a list of available fields from the api? and the fields metadata(is mandatory, field type...)?
And after that, How do I set the value of these fields?
I found this in the docs:
https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue
but it looks too complex for setting a field.
Issue can be created with following method and fields set only https://confluence.jetbrains.com/display/YTD6/Create+New+Issue . So as you mentioned, it's
PUT /rest/issue?{project}&{summary}&{description}&{attachments}&{permittedGroup}
It's assumed, other fields can be updated within next call. ApplyCommand (https://confluence.jetbrains.com/display/YTD6/Apply+Command+to+an+Issue)method is pretty good example of such a method.
If you need to know all available fields in the projects, here is the method https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Fields.
Meta can be called with the following https://confluence.jetbrains.com/display/YTD6/GET+Project+Custom+Field. As you can see, details are available on per field basis.

Use custom function to populate gSpreadsheet cell based on a XML/JSON response

Ok, this one has become a little tricky for me and I really need some assistance to work through it.
Problem
I have a GSpreadsheet which has a list of data, in this case Twitter usernames. Using the API of a service provider (in this case the Klout API), I would like to retrieve information about that user to populate a cell within a spreadsheet.
Based on what I can work out so far, I would need to write a custom function to do this but I have no idea where to start, how I might construct it, or if there are any examples of doing this.
Scenario
The Klout API can return either an XML or JSON response (see http://developer.klout.com/docs/read/api/API), based on the string passed. For example, the URL:
http://api.klout.com/1/users/show.xml?key=SECRET&users=thewinchesterau
would return the following XML response:
<users>
<user>
<twitter_id>17439480</twitter_id>
<twitter_screen_name>thewinchesterau</twitter_screen_name>
<score>
<kscore>56.63</kscore>
<slope>0</slope>
<description>creates content that is spread throughout their network and drives discussions.</description>
<kclass_id>10</kclass_id>
<kclass>Socializer</kclass>
<kclass_description>You are the hub of social scenes and people count on you to find out what's happening. You are quick to connect people and readily share your social savvy. Your followers appreciate your network and generosity.</kclass_description>
<kscore_description>thewinchesterau has a low level ofinfluence.</kscore_description>
<network_score>58.06</network_score>
<amplification_score>29.16</amplification_score>
<true_reach>90</true_reach>
<delta_1day>0.3</delta_1day>
<delta_5day>0.5</delta_5day>
</score>
</user>
</users>
Based on this response, I would like to be able to populate different cells with the values returned within the XML (or JSON if easier) packet.
So, for example, I would have a spreadsheet like the following which would have custom functions to go out and retrieve the value of the relevant XML element response to populate the cell:
Cell A B C D E
1 Username kscore Network score Amplification score True reach
2 thewinchester =kscore(A2) =nscore(A2) =ascore(A2) =tscore(A2)
Questions
Are there any gSpreadsheet examples you know of that use an API to pull data in from an external source?
How would one write a custom function to fetch the result from the API and populate a cell with a result of a specific element?
Any information, examples or helpers you have are greatly appreciated.
You want the importXML function, documented here. The formula you want will look something like this:
=importXML("http://api.klout.com/1/users/show.xml?key=SECRET&users=" + A1, "//users/user/score/kscore")
You could write a custom script with Google AppScript, but there's a simple solution to this similar to what Nick Johnson posted. I've tested this against the score function, but it could be easily adapted to the show endpoint with different XPath.
=importXML("http://api.klout.com/1/klout.xml?users="&A1&"&key=YOUR_API_KEY", "//users/user/kscore")
This presumes your Twitter IDs are in the A column.
Note, Google Docs limits the number of such importXML functions to 50 per spreadsheet. You could concatenate groups of 5 userids for each importXML call, effectively putting your limit to 250 a sheet.
This could also be adapted to a similar call in Excel that doesn't have that limit. Keep in mind the Klout ToS, though, using proper attribution and rate limits.