Update phone1 and phone2 with Moodle's webservice - moodle

I read Moodle's API but I can't update phone1 and phone2 with user'ID with webservice.
The WS core_user_update_users doesn't take phone1 and phone2's field.
How can I update these fields with webservice?

Currently you cannot. You can, however, update custom user profile fields, so you may want to create phone(s) field(s) with custom profile field mechanism, and update it with the core_user_update_users webservice function

Related

Get specific product with id via Rest API Magento 2

I want to get the information from an specific product.
I am using this reference in this moment, and get all the products in given searchCriteria:
http://www.mysite.co/rest/V1/products-render-info?storeId=1&currencyCode=cop
Is there a way I can send the product id in the url and get only all its information?
You can add the filter
http://www.mysite.co/rest/V1/products?searchCriteria[filterGroups][0][filters][0][field]=entity_id&searchCriteria[filterGroups][0][filters][0][value]=1&searchCriteria[filterGroups][0][filters][0][condition_type]=eq
use field entity_id instead of id, value is product id here 1, condition_type is equal to here eq.
You can fetch product info by SKU, not ID.
API endpoint (get method) will pull product info. vendor/magento/module-catalog/etc/webapi.xml
/V1/products/:sku
So, your rest API calling URL should be like this
http://www.mysite.co/rest/V1/products/productsku
Note: If you want to fetch product info by id, you probably need to create a simple rest API. you can check this out.
https://magento.stackexchange.com/questions/282480/i-am-new-here-i-want-to-know-how-can-i-create-my-own-simple-api/282730

Is there a way to assign the primary category for a product in demandware using the Open Commerce API (OCAPI)?

The primary category of a product is present in the product document (primary_category_id) in the DATA API but cannot be written. After sending a PATCH update of the product with a different primary_category_id, it doesn't change.
Is there a way of doing this through the OCAPI?
Can be some limitation for PATCH Method.Fields that can be updated:
name,
page_description,
long_descripton,
page_title,
page_keywords,
brand,
ean,
upc,
manufacture_sku,
manufacture_name,
searchable,
unit,
searchable,
online_flag,
default_variant_id.
Try with PUT Method. PUT https://hostname:port/dw/data/v19_1/products/{id}. Also,
please check Request Document.
At this time it does not appear that this is possible to manage via OCAPI.
I suspect that in the future you'd be able to achieve it using the following resources:
DELETE /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
followed by:
PUT /catalogs/{catalog_id}/categories/{category_id}/products/{product_id}
With a ProductCategoryAssignment document in the PUT call.
However, this would require that Salesforce adds those attributes to the ProductCategoryAssignment document.
The reason I suggest this is where it would be added is that within a catalog import document (XML) the flags are associated with a similar resource representation. eg:
<category-assignment category-id="gear-bags-backpacks" product-id="NSF4003100">
<primary-flag>true</primary-flag>
</category-assignment>

Restrict Custom Field Value Responses for Contacts

When sending a GET query for matters, you can use the custom_field_ids[] key with a custom field id as the value to pull down the fields for a specific custom field assigned to a matter.
The documentation shows no similar functionality for the contact object. I'm having to pull all custom_field_values{field_name,value} and parse this result to find the specific custom field value I'm looking for, when I'm querying a contact.
Is there a better way to get the custom field value for a specific custom field id for contacts than what I'm doing above? If not, I'd love to see the custom_field_ids[] parameter applied to the contact object.

Get more product field value in Algolia json data

We are using Algolia extension for Magento 2. We added 2-3 field in the products, so we want to show the value of those fields on instant search result page. As we checking the view/frontend/templates/instant/hit.phtml is in use, we want to add the custom attributes to the JSON data so we can fetch those attributes value and show in listing page.
First you have to add new fields to Algolia product index if not already added. You can use one of the custom backend events. e.g. algolia_after_create_product_object
Once your fields are indexed properly (verify from Algolia account console), you should be able to get those in hit.phtml

SurveyMonkey Email Collector Custom Values

In order to include information (like an order number) in a survey using an Email Collector, it's my understanding that this information needs to be stored in the Contact's custom variables. My concern is what happens if I am sending something like a customer satisfaction survey that needs to reference the order number, and the same customer (email address) places more than one order, and I have to send out more than one survey.
Will the custom values that are returned with the collectors/.../responses API call include the custom values at the time of the survey invite? Or will these be set to current values?
The custom values are stored on the response at the time the survey is taken. So if they change later, they will not change on the response. This will work fine as long as you don't sent out another survey with new custom values to the same contact before they respond to the previous one.
Just an FYI, there is also an option to set extra_fields on a recipient when adding recipients to an email collector (rather than on the contact).
POST /v3/collectors/<collector_id>/messages/<message_id>/recipients
{
"email": "test#example.com",
"extra_fields": {
"field1": "value1",
"field2": "value2"
}
}
I don't believe that data is stored with he response, but the recipient_id is and you can fetch the recipient by ID to get that data back.
Those are two options, you can see which one works best for you. The benefit of contact custom values is that you can view them and edit them from the web, whereas extra_fields are API only fields.