Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createProduct - 400 Bad Request #18

Open
erdikoroglu opened this issue Nov 6, 2021 · 2 comments
Open

createProduct - 400 Bad Request #18

erdikoroglu opened this issue Nov 6, 2021 · 2 comments

Comments

@erdikoroglu
Copy link

Client error: "POST https://api.trendyol.com/sapigw/suppliers/--MAGAZAID--/v2/products" resulted in a "400 Bad Request" response: {"timestamp":1636202783839,"exception":"ClientApiBusinessException","errors":[{}]}

Olarak hata döndürüyor.

env dosyasına URL ekledim.
Sonuç aynı.
Ayrıca laravel 8 için composer gereksinimlerini güncellersen sevinirim.

@erdikoroglu
Copy link
Author

erdikoroglu commented Nov 6, 2021

`$data = TrendyolProduct::find(1);
$json = burada_json data mevcut';
$conv = json_decode($json,true); ->> array çevirdim

$product = new Product($conv); -> model gonderdım
$result = Trendyol::create('KEY','SECRET','SUPPLIER')
->productService()
->creatingProducts();
$result->addProduct($product);
$service = $result->create();
return response()->json($service);`

hata var mı ?

@erdikoroglu
Copy link
Author

$response = $this->client->$method($path, [ RequestOptions::SYNCHRONOUS => false, RequestOptions::HEADERS => [ 'Accept' => 'application/json', 'Content-Type' => 'application/json', 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' ], RequestOptions::JSON => $data, RequestOptions::MULTIPART => $multipart, ]);

User Agent ekledım ama kontrol ettiğimde.
"headers" => array:1 [▼ "User-Agent" => "GuzzleHttp/7" ]

olarak çıktı veriyor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant