• Resolved iparcelbox

    (@iparcelbox)


    I’m wanting to use the REST API to get Affiliate details for a particular user_id.

    I’m trying to call the equivalent of slicewp_get_affiliate_by_user_id() from the REST API. I see there is an API get call https://example.com/wp-json/slicewp/v1/affiliates/ to get all affiliates, but I’ve tried passing a query parameter e.g. ?user_id=12 but it doesn’t seem to work and Postman still just returns the full list of affiliates.

    How can I use the REST API to pass specific data, either as a GET or POST request, e.g. using Postman?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @iparcelbox,

    Thank you for reaching out! I’m afraid that we do not have an equivalent to slicewp_get_affiliate_by_user_id() with the REST API. Also, I’m not sure if this is something that we will be adding in the foreseeable future.

    Even so, we already have plans to extend the https://example.com/wp-json/slicewp/v1/affiliates/ get request to include the user_id parameter. This has been asked before and we will be shipping this in the next update.

    With it, you’ll be able to make a get request and pass the user_id parameter, which will return an array of affiliates based on the supplied user ID(s).

    Thank you and best wishes,

    Mihai

    Thread Starter iparcelbox

    (@iparcelbox)

    That would be great, thanks. Is there a timescale for the next update? I’m keen to check that the fundamentals I need are going to work whilst I’m still in my 30 day period. Being able to get the key details of an existing affiliate, change their status and payment email address and get details of commission %, together with a list of commissions is all pretty crucial!

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @iparcelbox,

    If all goes well, this addition will be released sometime this week. Also, considering that you’re still in testing mode, I’m happy to to offset your refund period by the number of days from today until this new update is released.

    Thank you and best wishes,

    Mihai

    Thread Starter iparcelbox

    (@iparcelbox)

    Many thanks, I can see that the user_id parameter has now been added and I can get the basic details. However, I can’t see how I can get the affiliate URL via the API. Please can you provide details on how the REST API allows access to similar functions as the WP functions?

    I need to retrieve data on the following:

    1. payment email (OK via /affiliate/id)

    2. Account status

    3. Affiliate link

    4. Details of commissions for a particular affiliate ID

    5. Details of visits tagged to a particular affiliate ID

    6. List of payouts for a particular affiliate ID

    I also need the ability to update the following:

    1. Status
    2. payment email

    Is there an open GitHub repo where I can see what is available on the REST API, and contribute to the development of these if not already available?

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @iparcelbox,

    From a technical standpoint, the REST API does not offer all of the functionality that the PHP API does.

    Even so, most of the information you’re looking to grab can be handled by the REST API.

    Considering that you need more information about the REST API and that this is a Pro feature, please contact us via our website, here: https://slicewp.com/contact/

    These forums are destined for the core free plugin. As soon as you contact us via our website, I’ll get back to you as quickly as possible.

    Thank you and best wishes,

    Mihai

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘REST API equivalent of slicewp_get_affiliate_by_user_id()’ is closed to new replies.