REST API Translate

Hi,
I need help :frowning: for some command in JSON where CLI like this - POST
/ppp secret set name=yyy numbers=[find name=xxx]

or another way for solving update data like that
Your help is very much appreciated..

You can run query with post
https://help.mikrotik.com/docs/display/ROS/REST+API#RESTAPI-Query

and then set

https://IP/ppp/secret/set?numbers=[find name=xxx]
{“name” : “yyyy”}

I tried it at postman, it isnt works.
advice me how to translate here

numbers=[find name=xxx]

You cannot run find via API. Look at the link provided above which shows how to run queries

even though i put it inside query?
like this - POST body
{“.query”: [
“numbers=[find name=xxx]”
] }

/ppp secret set name=yyy numbers=[find name=xxx]
correct script way
/ppp secret set [find where name=xxx] name=yyy
extended syntax
/ppp secret set numbers=[find where name=xxx] name=yyy

First, GET the .id:
/rest/ppp/secret/name?name=xxx&.proplist=.id
(for example *5 )

Then PATCH that .id setting the new name:
/rest/ppp/secret/*5
{“name”: “yyy”}

Ok sir got it,
So we must do it at 2 step

Hope next we get more detail about REST :slight_smile:

Thanks for advice sir

I’ve tried patching on the ID to change the name but what ends up happening is that it creates a duplicate ppp secret entry with the name provided