---
schema_version: "1"
id: 548a953e002b27c79c88afff86931ae9ca3c237328920fe1826c4651a7d14d89
title: Declaring a Remote Method with Interface Parameters
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/javascript/pages-js-remoting-remote-method-interface-params.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-js-remoting-remote-method-interface-params.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: aa698f21b6111323289d195888e968d26795fecae7f1492629a3bb43c80dccd6
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Declaring a Remote Method with Interface Parameters

You can declare `@RemoteAction` methods with interface parameters and return types, instead of being restricted to concrete classes. With interface parameters and return types, a package provider can package a remote method and associated interface, which subscriber orgs can call from Visualforce pages. Subscriber orgs pass in their own class that implements the packaged interface.

**note:** If a `@RemoteAction` method is in a managed package and used by Visualforce Remoting, it must have global visibility if user profile or permission set access is used.

Here’s a brief example:

```apex
public class RemoteController {
    public interface MyInterface { String getMyString(); }
    public class MyClass implements MyInterface { 
        private String myString; 
        public String getMyString() { return myString; }
        public void setMyString(String s) { myString = s; }
    }
    
    @RemoteAction
    public static MyInterface setMessage(MyInterface i) {
        MyClass myC = new MyClass();
        myC.setMyString('MyClassified says "' + i.getMyString() + '".');
        return myC;
    }
}
```

Objects sent from a JavaScript remoting call to a `@RemoteAction` that declares interface parameters must include an `apexType` value, which must be a fully qualified path to the concrete class, that is, `namespace[.BaseClass][.ContainingClass].ConcreteClass`. For example, to make a JavaScript remoting call to `RemoteController`:

```javascript
Visualforce.remoting.Manager.invokeAction(
    '{!$RemoteAction.RemoteController.setMessage}',
    {'apexType':'thenamespace.RemoteController.MyClass', 'myString':'Lumos!'}, 
    handleResult
);
```

If the class definition is within your organization, you can simplify the remoting call and use the default `c` namespace:

```javascript
RemoteController.setMessage(
    {'apexType':'c.RemoteController.MyClass', 'myString':'Lumos!'}, 
    handleResult
);
```

**See Also**  


-   [Namespaces and JavaScript Remoting](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-js-remoting-namespaces.md)
-   [Scope and Visibility of @RemoteAction Methods](https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-js-remoting-scope-visibility.md)

