<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [ibm-cloud-sdk-core](./ibm-cloud-sdk-core.md) &gt; [constructServiceUrl](./ibm-cloud-sdk-core.constructserviceurl.md)

## constructServiceUrl() function

Constructs a service URL by formatting a parameterized URL.

**Signature:**

```typescript
export declare function constructServiceUrl(parameterizedUrl: string, defaultUrlVariables: Map<string, string>, providedUrlVariables: Map<string, string> | null): string;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

parameterizedUrl


</td><td>

string


</td><td>

a URL that contains variable placeholders, e.g. '<!-- -->{<!-- -->scheme<!-- -->}<!-- -->://ibm.com'.


</td></tr>
<tr><td>

defaultUrlVariables


</td><td>

Map&lt;string, string&gt;


</td><td>

a Map of variable names to default values. Each variable in the parameterized URL must have a default value specified in this map.


</td></tr>
<tr><td>

providedUrlVariables


</td><td>

Map&lt;string, string&gt; \| null


</td><td>

a Map of variable names to desired values. If a variable is not provided in this map, the default variable value will be used instead.


</td></tr>
</tbody></table>
**Returns:**

string

the formatted URL with all variable placeholders replaced by values.

