New answers tagged

0

Magento REST API expects only json encoded data (not url encoded data). Here is an example, show proper encoding of data and header. <?php $jsonEncodedData = json_encode(array('username'=>'user', 'password' => 'password')); $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "http://magento.local/rest/default/V1/integration/...


1

Magento 2 REST API only allows base64 encoded media gallery inputs. It requires customization if you want to change the input as file name. Try this extension to change the base64 input. Known issue related to your issue.


0

ProductAttributeOptionManagementInterface implement three methods check below 1. getItems 2. add 3. delete 1) Retrieve the list of attribute options using. public function getItems($attributeCode); 2) Add option to attribute public function add($attributeCode, $option); 3) Delete option from attribute public function delete($attributeCode, $...


0

I sourced out the answer to my question!. One simple cannot do: $my_custom_object = array("Key1" => "value!") OR $my_custom_object = json_encode(array("Key1" => "value!")); It expect the value to be an object: So setting customAttribute like so: $extensionAttributes->setOurCustomData($ourCustomData); $ourCustomData Must be an object: So I ...


1

You can filter normally as any other attribute. Use this URL below to request, I'm using the rule "if it's greater than 0 than" to get products, and I put the limit of 50 products. The counting of total products is included during the return as you can see in the image. https://www.mystore.com/ca_en/rest/all/V1/products? searchCriteria[filterGroups][0][...


0

We can do our custom endpoints too. I have extend some existing default graphql queries. 1 . Query storeConfig -( module-store-graph-ql ) 2 . Query products's ProductFilterInput - ( module-catalog-graph-ql ) 1 . Query storeConfig -( module-store-graph-ql ) I extended storeConfig using following steps. create a di.xml file under module's etc/graphql ...


0

I faced the same problem and fixed like below add below line to .htaccess in the magento root RewriteRule ^api/rest api.php?type=rest [QSA,L] and apache2.conf with below code: <Directory /var/www/html/magento/> Options Indexes FollowSymLinks AllowOverride All Order allow,deny allow from all Require all granted </Directory&...


0

I know it is a little late, but for anyone else looking for a way to get label values of custom attributes, and configurable item values via the rest api. I am presuming you want the custom attribute's label & value label, and not id & value_id as those do exist in the orders api. There are 3 steps we need to make in order to find all of the ...


1

First of all create manually a new Reports user, open : System->Extensions->Integrations Check is a user with the name "Magento Analytics user" is there. If not please do the next steps: press New Integration button paste the name - "New Integration", into the name input. in the field "Your Password" type the current admin password at the left ...


1

Try this bulk endpoints Bulk API endpoints differ from other REST endpoints in that they combine multiple calls of the same type into an array and execute them as a single request. The endpoint handler splits the array into individual entities and writes them as separate messages to the message queue. To call a bulk endpoint, add the prefix /async/bulk ...


0

Easiest way is to add Allow origin to your .htaccess in home directory into your .htacess search for <IfModule mod_headers.c> and insert the follwing code : SetEnvIf Accept application/json API Header always set Access-Control-Allow-Origin "*" env=API Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT" env=API Header ...


0

I was receiving the same issues, then I noticed that I was using POST instead of GET, changing it the issues were solved.


1

One of the possible ways of extending existing GraphQl is using the GraphQl interface. As for example, you have a new product attribute barcode now you want it in GraphQl response. In that case in your custom module's etc > schema.graphqls file add as following interface ProductInterface { barcode: String @resolver (class: "Vendor\\Module\\Model\\...


Top 50 recent answers are included