linnsystems / linnworksnetsdk Goto Github PK
View Code? Open in Web Editor NEWLinnworks.net Developers
Linnworks.net Developers
Hello,
I am trying to upload a file on dropbox but the external code of Dropbox and their DLL does not support Linnworks.net Macro and I could not find any reference or information in this wiki SDK documentation.
I have seen a few pre-defined functioned developed in this SDK for FTP, SFTP, and Dropbox. I have managed to list all directly using this FTP function but I want to upload the file on Dropbox and I don't know how.
Also, I thought of alternate solution by using file upload on FTP but it's not explained as well.
I have seen and tried below function:
ProxyFactory.GetDropboxUploadProxy(DropboxSettings)
But I get "Null reference error". Also, I don't find any info on how to write a stream on the above function.
Please help if anyone had tried this. Thanks in advance.
Regards,
Hello,
I am using the .net sdk in order to connect to Linn api.
Connection works fine and i got back this object:
I use LinnworksAPI.AuthMethods.AuthorizeByApplication method in order to get the connection object (which seems it's fine).
but then ANY request to Linn api returns "nothing" without any error.
Tried:
GetStockLocations
GetStockItemsFull
GetStockItems
Note: Nothing changed on my .net software...
Besides the above.. I wonder from where i can download the newer (if exists) Linworks.dll??? I stongly believe that "dll" is created based on the code it's on this github repo.
I suspect that "something" has changed in between?
Hi,
I am trying to pull a list of orders from my LinnWorks account. I have some questions:
Inside of my application, I clicked the install link and I received a token. When I call the method, I get a 400 bad request. My URL is https://eu1.linnworks.net/api/Auth/AuthorizeByApplication. Am I posting to the wrong URL?
Here is my request:
POST https://eu1.linnworks.net//api/Auth/AuthorizeByApplication HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: eu1.linnworks.net
Content-Length: 148
Expect: 100-continue
Connection: Keep-Alive
applicationId=XX&applicationSecret=XX&token=XX
Response
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/8.5
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: *
Access-Control-Allow-Credentials: false
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept, Accept-Language
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Credentials: true
Date: Sat, 06 Feb 2016 17:52:13 GMT
Content-Length: 37
{"Message":"The request is invalid."}
Several classes have common elements eg. a Name and Guid property. It would make sense to have a base class/interface where possible to make it easier for developers to reuse code that consumes these objects
Hello,
(https://apps.linnworks.net/Api/Method/Auth-AuthorizeByApplication)
I need help because the documentation is not clear to me.
I created an application in LW and have Application ID and Secret as well.
I want to get the token so I’ve sent POST data to
https://api.linnworks.net/api/Auth/AuthorizeByApplication
CULR --
'Host: api.linnworks.net',
'Connection: keep-alive',
'Accept: application/json, text/javascript, /; q=0.01',
'Origin: https://www.linnworks.net',
'Accept-Language: en',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'Referer: https://www.linnworks.net/',
'Accept-Encoding: gzip, deflate’,
POST --
'applicationId' => $ApplicationId,
'applicationSecret' => $ApplicationSecret,
'userId' => ‘HOW TO GET IT?'
I’m getting
string(85) "{"Code":"-","Message":"An internal error occurred. Please contact Linnworks support”}"
this value object requires array while convention in this sdk is to use lists, this causes need for conversions, that are not needed
I want to update product inventory using product SKU for that I call below API
InventoryMethods::GetStockLocations($ApiToken, $ApiServer);
Then I Call StockMethods::GetStockItems('TEST_SS7050',$GetStockLocation->StockLocationId,1,1,true, true, true,$ApiToken, $ApiServer); API
Then I Call InventoryMethods::UpdateInventoryItemStockField($stockItem->StockItemId,'Available','50',$GetStockLocation->StockLocationId,null, $ApiToken, $ApiServer);
Thank You.
I carefully followed .pdf guide for integration channel but none of registered callbacks are ever called after installation.
But if I add ExternalApplication or ExternalUserInterface, I do get postbackUrl called and embedded iframe, both work flawlessly.
According to this page https://help.linnworks.com/support/solutions/articles/7000007438-what-is-a-manifest- , it looks like channel integration is not supported anymore. Can you confirm that?
My manifest (replaced real url) in case I missed something. Not all URL's are registered but I would get 404 logged if those were called:
{
"modules": [
{
"type": "ExternalApplication",
"parameters": [
{
"name": "PostbackUrl",
"value": "https://example.com/app_dev.php/linnworks/postback?token=[{TOKEN}]&tracking=[{TRACKING}]"
}
]
},
{
"path": "",
"type": "ExternalUserInterface",
"moduleName": "MyDashboard",
"formattedName": "My Dashboard",
"icon": "fa fa-usd",
"parameters": [
{
"name": "URL",
"value": "https://example.com/app_dev.php/linnworks/embedded/[{TOKEN}]"
}
]
},
{
"type": "ChannelIntegration",
"parameters": [
{
"name": "ChannelName",
"value": "MYINTEGRATION"
},
{
"name": "ChannelFriendlyName",
"value": "My integration 3"
},
{
"name": "ChannelLogoURL",
"value": "https://example.com/images/logo.png"
},
{
"name": "AddNewUserEndpoint",
"value": "https://example.com/app_dev.php/linnworks/new_user"
},
{
"name": "UserConfigEndpoint",
"value": "https://example.com/app_dev.php/api/Config/UserConfig"
},
{
"name": "SaveConfigEndpoint",
"value": "https://example.com/app_dev.php/api/Config/SaveUserConfig"
},
{
"name": "ShippingTagsEndpoint",
"value": "https://example.com/app_dev.php/api/Config/ShippingTags"
},
{
"name": "PaymentTagsEndpoint",
"value": "https://example.com/app_dev.php/api/Config/PaymentTags"
},
{
"name": "ConfigDeletedEndpoint",
"value": "https://example.com/app_dev.php/linnworks/user_deleted"
},
{
"name": "ConfigTestEndpoint",
"value": "https://example.com/app_dev.php/linnworks/config_test"
},
{
"name": "OrdersEndpoint",
"value": "https://example.com/app_dev.php/api/Order/Orders"
},
{
"name": "DespatchEndpoint",
"value": "https://example.com/app_dev.php/api/Order/Despatch"
},
{
"name": "ProductsEndpoint",
"value": "https://example.com/app_dev.php/api/Product/Products"
},
{
"name": "InventoryUpdateEndpoint",
"value": "https://example.com/app_dev.php/api/Product/InventoryUpdate"
},
{
"name": "PriceUpdateEndpoint",
"value": "https://example.com/app_dev.php/api/Product/PriceUpdate"
},
{
"name": "InventoryUpdateBatchSize",
"value": "1000"
},
{
"name": "DespatchUpdateBatchSize",
"value": "100"
},
{
"name": "PriceUpdateBatchSize",
"value": "1000"
}
]
}
]
}
Hi,
I'm a very newbie 'developer' (can't really call myself a developer... yet?). I can authenticate and I get the session token back which I try to use to get my inventory items, without success.
Note that I tried to get, for example, location info based on location_id and it worked, so I'm not sure what I do wrong in trying to get the inventory items. Here is my code:
my small (just 100 lines) Linnworks.py script
I'm sure it's some silly mistake, yet I cannot figure it out. I tried to follow the API docs as close as possible.
Similarly, is there any easier/better way to fetch the GUIDs for my items? I tried to search the API docs and found that probably the only way is through Inventory.
Edit:
I see I can fetch item ids info using query: "SELECT pkStockItemID, ItemNumber, ItemTitle FROM StockItem WHERE bLogicalDelete = 0" with api/Dashboards/ExecuteCustomScriptQuery. However, I would still like to know why my original script does not work :/.
And some other APIs seem to be no longer working. Is there any up to date list I can check out to see which APIs are still working and which are not?
Add this method to the OrderMethod Class:
public static List SetExtendedProperties(Guid orderId, ExtendedProperty[] extendedProperties, String ApiToken, String ApiServer)
{
return Newtonsoft.Json.JsonConvert.DeserializeObject<List>(Factory.GetResponse("Orders/SetExtendedProperties", "orderId=" + orderId + "&extendedProperties=" + Newtonsoft.Json.JsonConvert.SerializeObject(extendedProperties) + "", ApiToken, ApiServer), new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
}
file_get_contents(https://us-ext.linnworks.net/api/Orders/SetOrderCustomerInfo): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
my code:
$order = OrdersMethods::CreateNewOrder(self::fulfilmentCenter, $this->token, $this->server); OrdersMethods::SetOrderCustomerInfo($order->OrderId, $customer_info, false, $this->token, $this->server);
Occasionally connection is broken and we receive error The request was aborted: Could not create SSL/TLS secure channel. returned error (4 cases on 190 connections) .
Works fine with direct http connection.
We confirmed that backend didn't receive those requests and problem is in between CloudFlare and Linnworks.
Hi,
I am trying to pull a list of orders by date. I called the AuthorizeByApplication method and received a token with server. I have added the token and server to my request. I have some questions:
Here is my request:
POST https://us1.linnworks.net/Orders/GetAllOpenOrders HTTP/1.1
Accept: application/json
Content-Type: application/x-www-form-urlencoded
Authorization: XX
Host: us1.linnworks.net
Content-Length: 258
Expect: 100-continue
Connection: Keep-Alive
entriesPerPage=1&pageNumber=1&filters={"TextFields":null,"BooleanFields":null,"NumericFields":null,"DateFields":[{"DateFrom":"2016-02-03T10:35:05.942697-05:00","DateTo":"2016-02-08T10:35:05.9477296-05:00","Type":0,"Value":0,"FieldCode":1}],"ListFields":null}
Response
HTTP/1.1 404 Not Found
This is not an issue... but just wanted to let you know that I am developing the Linnworks API in the Java language here: https://github.com/Notronix/JaLAPI
Feel free to contribute or give feedback.
Clint
It would be really good if we could only have the language we're working on as dependency. I can't see any benefit on this repository supporting 3 languages.
It is dead easy for you guys to turn the PHP folder into a composer project and the JS folder into a nodejs one (in separate repositories).
Thanks
Json object dates aren't formatted correctly so cause errors in API calls and URL param dates aren't formatted at all so get converted using the system default date format by the DateTime.ToString() function.
I need to be able to update the Item's Title - But despite changing it, the UpdateOrderItem method doesn't seem to update this.
Hi,
I am using the php code, and trying to upload data using UpdateStockLevels and no matter what I try, I always seem to get a 400 response. I am getting the authentication token back, and then getting the warehouse id back fine. I have tried using the UpdateStockLevel class object, rolling my own array, and even building the json object "by hand" bases on the api docs, but nothing seems to work. Have you got any working examples of php code using the SDK that I could use to figure out where I am goign wrong, or even just a quick explanation of what I am supposed to send to the function?
Ta.
Marco
I'm working on a Fedora Linux system with dotnet 3.1 SDK installed as per instructions at https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install and this environment has more or less worked well for me for years.
I cloned the LinnworksNetSDK project today for the first time in over a year, and I see it has moved to dotnet 3.1, see commit c6b81a6 for the readme update, and the following commit aeadfbd updates lots of files. One of them is the new file Linnworks/src/netcore/LinnworksAPI/ClassBase/SqlMetaData.cs
which has the lines:
using System.Data.SqlClient;
and
public SortOrder SortOrder { get; set; }
Both of these generate compile errors for me using the Linux dotnet 3.1 SDK:
* Executing task: /home/neek/dotnet/dotnet build /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
Microsoft (R) Build Engine version 16.2.37902+b5aaefc9f for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 141.02 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacro/LinnworksMacro.csproj.
Restore completed in 141.03 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacroHelpers/LinnworksMacroHelpers.csproj.
Restore completed in 141.02 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj.
Restore completed in 141.03 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj.
/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/ClassBase/SqlMetaData.cs(6,19): error CS0234: The type or namespace name 'SqlClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj]
/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/ClassBase/SqlMetaData.cs(30,10): error CS0246: The type or namespace name 'SortOrder' could not be found (are you missing a using directive or an assembly reference?) [/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj]
* The terminal process "/home/neek/dotnet/dotnet 'build', '/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
* Executing task: /home/neek/dotnet/dotnet build /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
Microsoft (R) Build Engine version 16.2.37902+b5aaefc9f for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 25.07 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacroHelpers/LinnworksMacroHelpers.csproj.
Restore completed in 25.06 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj.
Restore completed in 25.07 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacro/LinnworksMacro.csproj.
Restore completed in 25.08 ms for /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj.
LinnworksAPI -> /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/bin/Debug/netstandard2.0/LinnworksAPI.dll
LinnworksMacroHelpers -> /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacroHelpers/bin/Debug/netstandard2.0/LinnworksMacroHelpers.dll
LinnworksMacro -> /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacro/bin/Debug/netstandard2.0/LinnworksMacro.dll
LinnMacroCustomer -> /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/bin/Debug/netcoreapp2.1/LinnMacroCustomer.dll
* Terminal will be reused by tasks, press any key to close it.
* Executing task: /home/neek/dotnet/dotnet build /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary
Welcome to .NET Core 3.1!
---------------------
SDK Version: 3.1.426
Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Find out what's new: https://aka.ms/dotnet-whats-new
Learn about the installed HTTPS developer cert: https://aka.ms/aspnet-core-https
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Write your first app: https://aka.ms/first-net-core-app
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 16.7.3+2f374e28e for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacro/LinnworksMacro.csproj (in 8.96 sec).
Restored /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksMacroHelpers/LinnworksMacroHelpers.csproj (in 8.96 sec).
Restored /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj (in 8.96 sec).
Restored /home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnMacroCustomer/LinnMacroCustomer.csproj (in 12.19 sec).
/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/ClassBase/SqlMetaData.cs(6,19): error CS0234: The type or namespace name 'SqlClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) [/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj]
/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/ClassBase/SqlMetaData.cs(30,10): error CS0246: The type or namespace name 'SortOrder' could not be found (are you missing a using directive or an assembly reference?) [/home/neek/workspace/LinnworksNetSDKProjects/CheckIncompleteZenMacro/Linnworks/src/netcore/LinnworksAPI/LinnworksAPI.csproj]
I'm not very familiar with dotnet SDK versions but it does look like System.Data.SqlClient
does not exist in 3.1, see https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient?view=dotnet-plat-ext-7.0&viewFallbackFrom=netcore-3.1 .. it seems to say they are in .NET Platform Extensions 7
. Reading about this leads me to think this is a nuget package that ships independently to the .NET SDK (re: https://stackoverflow.com/questions/53097067/what-are-net-platform-extensions-on-docs-microsoft-com).
Do you think a dependency is missing somehow on the LinnworksNetSDK project that would automatically install these .NET Platform Extensions, or is this a manual step I must take? I'm not working in the full Visual Studio where I last used nuget, I have Visual Studio Code on Linux and apparently the dotnet SDK does not ship with nuget. I can install a nuget
package from my package manager but it's one that depends on mono
packages so I don't think it will play nice with the dotnet 3.1 SDK I've installed.
There is no reason that the parameters/return types should require List - it is better practice to use as general purpose a type as possible, which would allow all other enumerable types to be passed/returned.
Basically as the title says. The core SDK has been updated loads recently, but the normal non-core SDK hasn't been touched in just over a year. What's going on? Has it been discontinued? Because if so maybe the Readme.md should be updated to reflect that.
We would like to point out unclear situation with Channel Integration Guide (https://github.com/LinnSystems/LinnworksNetSDK/blob/master/Linnworks/Example%20Applications/SampleChannel/Channel%20Integration%20Endpoint%20Guide.pdf).
Returns in Prices and Despatch do not clearly indicate that list of items that were successfully processed should be returned with information about lack of Error in form of:
{ "Error": null, "Products": [{ "Error": null", "SKU": "SKUOfProductEverythingFine" }] }
Please confirm if such behavior is a good one.
When calling Orders/GetOrderViews, I was expecting the views assigned to the authorised user to be returned.
However it appears that the application is created as a new user and a default set of views is generated and returned. This is not very helpful when trying to get orders for the user filtered by the view that they have created.
To Reproduce
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.