Giter Site home page Giter Site logo

Comments (6)

nVuln avatar nVuln commented on June 10, 2024 1

in new api, they no longer used base64 for uploaded file, I'll patch it soon

from tiktokshop-php.

sunil11475-dev avatar sunil11475-dev commented on June 10, 2024 1

No worries, figure it out - I have added the code below, may help someone :)

$resp = $client->Product->createProduct([
	'title' => 'This product title',
	'description' => "this is description",
	'category_id' => '809608',
	'main_images' => [[ 'uri'=>'tos-useast2a-i-tulkllf4y5-euttp/ca3dfdfff47adc4c41adc5a8080147dd39']],
	'skus' => [[
		'seller_sku' => 'SKU-PRO-TEST',
		'inventory' => [[
			'warehouse_id'=>'7292840624437780256',
			'quantity'=> (int)99,
		]],
		'price' => [
			'amount'=>'18.99',
			'currency'=>'GBP',
		],
	]],
	'package_weight' => [
		'value'=>(string)0.750,
		'unit' => 'KILOGRAM',
	],
	'package_dimensions' => [
		'length' => (string)45,
		'width' => (string)35,
		'height' => (string)16,
		'unit' => 'CENTIMETER',
	],

]);

from tiktokshop-php.

nVuln avatar nVuln commented on June 10, 2024 1

$response = $client->Product->searchProducts($params = [], $page_size = 100, $page_token);

I did some mistake in previous version, please try this

$client->Product->searchProducts([
    'page_size' => 100,
    'page_token' => 'xxxxxxx'
], [
    'status' => 'ALL'
]);

or combine it in first param, plugin will extract it automatic

$client->Product->searchProducts([
    'page_size' => 100,
    'page_token' => 'xxxxxxx',
    'status' => 'ALL',
]);

by this change, if tiktok added more query param in future, we don't need to change anything

from tiktokshop-php.

sunil11475-dev avatar sunil11475-dev commented on June 10, 2024

Perfect, thanks worked - Now when i using the URI code into create product, i am getting below error -

[*message] => param body.main_images type invalid,actual type is:map[string]interface {},expected type is:list

In array -

 [main_images] => Array(
            [uri] => tos-useast2a-i-tulkllf4y5-euttp/ca329ff47adc4c41adc5a8080147dd39
)......

from tiktokshop-php.

sunil11475-dev avatar sunil11475-dev commented on June 10, 2024

Thanks for fixing the issue for upload image but now same error showing on products/search - unsupported Media Type

It was working before - products/search

$response = $client->Product->searchProducts($params = [], $page_size = 100, $page_token);

EcomPHP\TiktokShop\Resource

                  [args] => Array
                       (
                           [0] => POST
                           [1] => products/search
                           [2] => Array
                               (
                                   [query] => Array
                                       (
                                       )
                                   [form_params] => 100
                               )
                       )
               )

from tiktokshop-php.

sunil11475-dev avatar sunil11475-dev commented on June 10, 2024

it worked.

Thanks again for your help.

from tiktokshop-php.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.