*

Den

  • *
  • 1 posts
Post new ad with images
« on: November 26, 2021, 07:03:46 AM »
Hi all,

Anyone successfully post ad with images, using RestApi plugin?

Please help me

I’m stuck on images uploading

*

MB Themes

Re: Post new ad with images
« Reply #1 on: November 26, 2021, 03:25:08 PM »
@den
Can you send what you got? I.e. via postman collection.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Marked as best answer by frosticek on February 01, 2022, 06:12:28 AM
*

MB Themes

Re: Post new ad with images
« Reply #2 on: November 26, 2021, 03:42:57 PM »
@Den
Here is functional one.
Do not forget to update "photos[]" parameter in "Body" tab.

Just in case attachment would get removed one day :)
Code: [Select]
{
"info": {
"_postman_id": "0e0edc2e-d324-4a3b-89e0-6fd217dbbf99",
"name": "Testing",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "New listing Rest",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "photos[]",
"type": "file",
"src": [
"/C:/Users/MichalBrezak/Desktop/screencapture-dev3-abprofitrade-eu-oc-admin-index-php-2020-06-12-12_56_04.png",
"/C:/Users/MichalBrezak/Desktop/screencapture-dev3-abprofitrade-eu-oc-admin-index-php-2020-06-12-12_56_20.png"
]
}
]
},
"url": {
"raw": "https://plugins.abprofitrade.eu/oc-content/plugins/rest/api.php?key=test-api-key&type=insert&object=item&action=add&catId=31&contactName=John Doe&[email protected]&price=543000&countryId=US&currency=USD&title[en_US]=Test item XYZ bla bla 2&description[en_US]=Test Test Test Test Test Test Test Test Test Test Test Test",
"protocol": "https",
"host": [
"plugins",
"abprofitrade",
"eu"
],
"path": [
"oc-content",
"plugins",
"rest",
"api.php"
],
"query": [
{
"key": "key",
"value": "test-api-key"
},
{
"key": "type",
"value": "insert"
},
{
"key": "object",
"value": "item"
},
{
"key": "action",
"value": "add"
},
{
"key": "catId",
"value": "31"
},
{
"key": "contactName",
"value": "John Doe"
},
{
"key": "contactEmail",
"value": "[email protected]"
},
{
"key": "price",
"value": "543000"
},
{
"key": "countryId",
"value": "US"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "title[en_US]",
"value": "Test item XYZ bla bla 2"
},
{
"key": "description[en_US]",
"value": "Test Test Test Test Test Test Test Test Test Test Test Test"
}
]
}
},
"response": []
}
]
}
« Last Edit: February 01, 2022, 06:12:20 AM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

MB Themes

Re: Post new ad with images
« Reply #3 on: November 26, 2021, 03:46:15 PM »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Smithtech

  • ****
  • 219 posts
Re: Post new ad with images
« Reply #4 on: November 16, 2023, 02:01:10 PM »
@Den
Here is functional one.
Do not forget to update "photos[]" parameter in "Body" tab.

Just in case attachment would get removed one day :)
Code: [Select]
{
"info": {
"_postman_id": "0e0edc2e-d324-4a3b-89e0-6fd217dbbf99",
"name": "Testing",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "New listing Rest",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "photos[]",
"type": "file",
"src": [
"/C:/Users/MichalBrezak/Desktop/screencapture-dev3-abprofitrade-eu-oc-admin-index-php-2020-06-12-12_56_04.png",
"/C:/Users/MichalBrezak/Desktop/screencapture-dev3-abprofitrade-eu-oc-admin-index-php-2020-06-12-12_56_20.png"
]
}
]
},
"url": {
"raw": "https://plugins.abprofitrade.eu/oc-content/plugins/rest/api.php?key=test-api-key&type=insert&object=item&action=add&catId=31&contactName=John Doe&[email protected]&price=543000&countryId=US&currency=USD&title[en_US]=Test item XYZ bla bla 2&description[en_US]=Test Test Test Test Test Test Test Test Test Test Test Test",
"protocol": "https",
"host": [
"plugins",
"abprofitrade",
"eu"
],
"path": [
"oc-content",
"plugins",
"rest",
"api.php"
],
"query": [
{
"key": "key",
"value": "test-api-key"
},
{
"key": "type",
"value": "insert"
},
{
"key": "object",
"value": "item"
},
{
"key": "action",
"value": "add"
},
{
"key": "catId",
"value": "31"
},
{
"key": "contactName",
"value": "John Doe"
},
{
"key": "contactEmail",
"value": "[email protected]"
},
{
"key": "price",
"value": "543000"
},
{
"key": "countryId",
"value": "US"
},
{
"key": "currency",
"value": "USD"
},
{
"key": "title[en_US]",
"value": "Test item XYZ bla bla 2"
},
{
"key": "description[en_US]",
"value": "Test Test Test Test Test Test Test Test Test Test Test Test"
}
]
}
},
"response": []
}
]
}


Still investigating this. The title, description, prices and some other details in this Postman request do not match the listing on this link: https://plugins.abprofitrade.eu/vehicles/cars/test-item-xyz-bla-bla-2_i1429. Has the listing been  updated afterwards?

Because we have tried the same request in post man but id doesn't seem to be working.

Thank you for the clarification.