How to customize user rest api?

Question

I am building a website VueJS and wordpress rest api. I am now working on author rest api. When i send get users :

get http://www.mywebsite.org/wp-json/wp/v2/users

I have the following result :

[
    {
        "id": 1,
        "name": "Christian DOE",
        "url": "",
        "description": "Whats'up men ",
        "link": "http://www.mywebsite.org/author/davy-kialagmail-com/",
        "slug": "christian,
        "avatar_urls": {
            "24": "http://1.gravatar.com/avatar/7cd93799879d879e4f3a9d6f35e78fd3?s=24&d=mm&r=g",
            "48": "http://1.gravatar.com/avatar/7cd93799879d879e4f3a9d6f35e78fd3?s=48&d=mm&r=g",
            "96": "http://1.gravatar.com/avatar/7cd93799879d879e4f3a9d6f35e78fd3?s=96&d=mm&r=g"
        },
        "meta": [],
        "acf": [],
        "_links": {
            "self": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users/1"
                }
            ],
            "collection": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users"
                }
            ]
        }
    },
    {
        "id": 3,
        "name": "Jean Charles",
        "url": "",
        "description": "It's me ",
        "link": "http://www.mywebsite.org/author/dkiala/",
        "slug": "charles",
        "avatar_urls": {
            "24": "http://1.gravatar.com/avatar/aa00691cc2b1cc4d3ad4f6be3a190877?s=24&d=mm&r=g",
            "48": "http://1.gravatar.com/avatar/aa00691cc2b1cc4d3ad4f6be3a190877?s=48&d=mm&r=g",
            "96": "http://1.gravatar.com/avatar/aa00691cc2b1cc4d3ad4f6be3a190877?s=96&d=mm&r=g"
        },
        "meta": [],
        "acf": [],
        "_links": {
            "self": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users/3"
                }
            ],
            "collection": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users"
                }
            ]
        }
    },
    {
        "id": 2,
        "name": "utilisateurtest",
        "url": "",
        "description": "Me aand me ",
        "link": "http://www.mywebsite.org/author/utilisateurtest/",
        "slug": "utilisateurtest",
        "avatar_urls": {
            "24": "http://2.gravatar.com/avatar/8eef2832389bb97a73c25d9ebe8583bd?s=24&d=mm&r=g",
            "48": "http://2.gravatar.com/avatar/8eef2832389bb97a73c25d9ebe8583bd?s=48&d=mm&r=g",
            "96": "http://2.gravatar.com/avatar/8eef2832389bb97a73c25d9ebe8583bd?s=96&d=mm&r=g"
        },
        "meta": [],
        "acf": [],
        "_links": {
            "self": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users/2"
                }
            ],
            "collection": [
                {
                    "href": "http://www.mywebsite.org/wp-json/wp/v2/users"
                }
            ]
        }
    }
]

My aim is to customize users rest api : i would like to have a list of user social link users.

Is there a plugin i can use to :
1. to set the user social link ?
2. To get those links exposed by rest api ?

If you have an idea, i would like to know.

Thanks for your help.

0
, , Pracede 9 months 0 Answers 91 views 0

Leave an answer