go get github.com/speakeasy-sdks/merge-ats-go
package main
import (
"context"
mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
"log"
)
func main() {
s := mergeatsgo.New(
mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var xAccountToken string = "<value>"
ctx := context.Background()
res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
if err != nil {
log.Fatal(err)
}
if res.AccountDetails != nil {
// handle response
}
}
- Retrieve - Get details for a linked account.
- Retrieve - Returns the account token for the end user with the provided public token.
- Create - Creates an
Activity
object with the given values. - List - Returns a list of
Activity
objects. - Retrieve - Returns an
Activity
object with the givenid
. - RetrievePostMetadata - Returns metadata for
Activity
POSTs.
- Create - Creates an
Application
object with the given values. - List - Returns a list of
Application
objects. - Retrieve - Returns an
Application
object with the givenid
. - RetrievePostMetadata - Returns metadata for
Application
POSTs. - UpdateChangeState - Updates the
current_stage
field of anApplication
object
- Create - Asynchronously pull data from an endpoint not currently supported by Merge.
- Retrieve - Retrieves data from earlier async-passthrough POST request
- Create - Creates an
Attachment
object with the given values. - List - Returns a list of
Attachment
objects. - Retrieve - Returns an
Attachment
object with the givenid
. - RetrievePostMetadata - Returns metadata for
Attachment
POSTs.
- Retrieve - Returns a list of models and actions available for an account.
- Create - Creates a
Candidate
object with the given values. - IgnoreCreate - Ignores a specific row based on the
model_id
in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. - List - Returns a list of
Candidate
objects. - Retrieve - Returns a
Candidate
object with the givenid
. - RetrievePatchMetadata - Returns metadata for
Candidate
PATCHs. - RetrievePostMetadata - Returns metadata for
Candidate
POSTs. - Update - Updates a
Candidate
object with the givenid
.
- DeleteAccountDelete - Delete a linked account.
- List - Returns a list of
Department
objects. - Retrieve - Returns a
Department
object with the givenid
.
- Create - Create a remote key.
- Create - Creates a
ScheduledInterview
object with the given values. - List - Returns a list of
ScheduledInterview
objects. - Retrieve - Returns a
ScheduledInterview
object with the givenid
. - RetrievePostMetadata - Returns metadata for
ScheduledInterview
POSTs.
- List - Returns a list of
JobInterviewStage
objects. - Retrieve - Returns a
JobInterviewStage
object with the givenid
.
- Create - Creates a link token to be used when linking a new end user.
- List - List linked accounts for your organization.
- Create - Pull data from an endpoint not currently supported by Merge.
- Create - Exchange remote keys.
- List - Returns a list of
RejectReason
objects. - Retrieve - Returns a
RejectReason
object with the givenid
.
- List - Returns a list of
Scorecard
objects. - Retrieve - Returns a
Scorecard
object with the givenid
.
- List - Get a linked account's selective syncs.
- RetrievePostMetadata - Get metadata for the conditions available to a linked account.
- Update - Replace a linked account's selective syncs.
- List - Get syncing status. Possible values:
DISABLED
,DONE
,FAILED
,PARTIALLY_SYNCED
,PAUSED
,SYNCING
- Create - Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available programmatically via API for monthly, quarterly, and highest sync frequency customers on the Core, Professional, or Enterprise plans. Doing so will consume a sync credit for the relevant linked account.
- List - Returns a list of
Tag
objects.
- List - Returns a list of
RemoteUser
objects. - Retrieve - Returns a
RemoteUser
object with the givenid
.
- Create - Creates a
WebhookReceiver
object with the given values. - List - Returns a list of
WebhookReceiver
objects.
Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
package main
import (
"context"
"errors"
mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
"github.com/speakeasy-sdks/merge-ats-go/pkg/models/sdkerrors"
"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
"log"
)
func main() {
s := mergeatsgo.New(
mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var xAccountToken string = "<value>"
ctx := context.Background()
res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
if err != nil {
var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}
}
}
You can override the default server globally using the WithServerIndex
option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
# | Server | Variables |
---|---|---|
0 | https://api.merge.dev/api/ats/v1 |
None |
1 | https://api-sandbox.merge.dev/api/ats/v1 |
None |
package main
import (
"context"
mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
"log"
)
func main() {
s := mergeatsgo.New(
mergeatsgo.WithServerIndex(1),
mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var xAccountToken string = "<value>"
ctx := context.Background()
res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
if err != nil {
log.Fatal(err)
}
if res.AccountDetails != nil {
// handle response
}
}
The default server can also be overridden globally using the WithServerURL
option when initializing the SDK client instance. For example:
package main
import (
"context"
mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
"github.com/speakeasy-sdks/merge-ats-go/pkg/models/shared"
"log"
)
func main() {
s := mergeatsgo.New(
mergeatsgo.WithServerURL("https://api.merge.dev/api/ats/v1"),
mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var xAccountToken string = "<value>"
ctx := context.Background()
res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
if err != nil {
log.Fatal(err)
}
if res.AccountDetails != nil {
// handle response
}
}
The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
}
The built-in net/http
client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.
import (
"net/http"
"time"
"github.com/myorg/your-go-sdk"
)
var (
httpClient = &http.Client{Timeout: 30 * time.Second}
sdkClient = sdk.New(sdk.WithClient(httpClient))
)
This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
TokenAuth |
apiKey | API key |
You can configure it using the WithSecurity
option when initializing the SDK client instance. For example:
package main
import (
"context"
mergeatsgo "github.com/speakeasy-sdks/merge-ats-go"
"log"
)
func main() {
s := mergeatsgo.New(
mergeatsgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
var xAccountToken string = "<value>"
ctx := context.Background()
res, err := s.AccountDetails.Retrieve(ctx, xAccountToken)
if err != nil {
log.Fatal(err)
}
if res.AccountDetails != nil {
// handle response
}
}
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!