Main goal is to expose apex service to externall apllication which should call URL with paremeters and get back a file or error message

1. Just simple service inside salesforce

Service accepts two parameters Company and street.

Apaex class:

global class as_remoteActivation {
    global static String genrateLicense(RestRequest req, RestResponse res) {

        System.debug('COMPANY: ' + company);
        System.debug('STREET: ' + street);
        return 'Done';

Main path for apex services is: where cs8 is your server name.
So comlete call will look like that:

2. Setting up OAuth authorization

Admisitrator shpuld configure remote accest as shown here section Setting up a Remote Access Application
External app should follow with this manual.

The two primary endpoints used with OAuth 2.0 are:
Authorization -
Token -


REST - basics, first document to read

OAuth how to login from external app auth URL structure
OAuth 2.0 Username-Password Flow